Aoun13
Chairman of Selectors
- Joined
- Apr 2, 2008
- Location
- Rawalpindi (Pak)
- Profile Flag
- Pakistan
- Online Cricket Games Owned
- Don Bradman Cricket 14 - Steam PC
Not wanting to be offensive,But that is stupid on your course / institution's part. printf was used in C, cout for C++.
Personally I would pass in the found account to the ddepo function. Since in the deposit() function you go through the linked list and find the correct account to deposit. In fact, you have to do that because ddepo has no notion of account number.so what can I do now to make it correct.
void dwith(node *dptr);
void ddepo(node *dptr);
Bank1.cpp
D:\PRG\CMD\CMD2\Bank1.cpp(18) : error C2065: 'node' : undeclared identifier
D:\PRG\CMD\CMD2\Bank1.cpp(18) : error C2065: 'dptr' : undeclared identifier
D:\PRG\CMD\CMD2\Bank1.cpp(18) : error C2182: 'dwith' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(19) : error C2182: 'ddepo' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(20) : error C2182: 'dcurrent_with' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(21) : error C2182: 'dcurrent_depo' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(22) : error C2182: 'deposit' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(23) : error C2182: 'withdrawal' : illegal use of type 'void'
D:\PRG\CMD\CMD2\Bank1.cpp(30) : error C2378: 'node' : redefinition; symbol cannot be overloaded with a typedef
D:\PRG\CMD\CMD2\Bank1.cpp(31) : error C2143: syntax error : missing ';' before '*'
D:\PRG\CMD\CMD2\Bank1.cpp(31) : error C2501: 'node' : missing storage-class or type specifiers
D:\PRG\CMD\CMD2\Bank1.cpp(31) : error C2501: 'dstart' : missing storage-class or type specifiers
D:\PRG\CMD\CMD2\Bank1.cpp(31) : error C2501: 'dtemp' : missing storage-class or type specifiers
D:\PRG\CMD\CMD2\Bank1.cpp(78) : error C2065: 'dprev' : undeclared identifier
D:\PRG\CMD\CMD2\Bank1.cpp(78) : error C2100: illegal indirection
D:\PRG\CMD\CMD2\Bank1.cpp(79) : error C2059: syntax error : ')'
D:\PRG\CMD\CMD2\Bank1.cpp(86) : error C2227: left of '->num' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(87) : error C2227: left of '->num' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(91) : error C2227: left of '->dtitle' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(93) : error C2227: left of '->dfname' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(95) : error C2227: left of '->dlname' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(97) : error C2227: left of '->dtel' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(101) : error C2227: left of '->bal' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(102) : error C2227: left of '->bal' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(107) : error C2227: left of '->dnext' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(110) : error C2440: '=' : cannot convert from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
D:\PRG\CMD\CMD2\Bank1.cpp(111) : error C2227: left of '->dfname' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(111) : error C2227: left of '->dfname' must point to class/struct/union
D:\PRG\CMD\CMD2\Bank1.cpp(111) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
Bank1.obj - 29 error(s), 0 warning(s)
You hit the nail on the head here.Personally I would pass in the found account to the ddepo function. Since in the deposit() function you go through the linked list and find the correct account to deposit. In fact, you have to do that because ddepo has no notion of account number.
Do you understand the problem? It should be a simple fix if you wrote the program in the first place.![]()