I only looked at the second set of source code, so I'm not comparing the two versions. So:
The code is clean, organized and straightforward, so that's a good design.
The code is "self-documenting" (i.e. what it does and how it works is apparent from the code itself), so you don't need to add significant comments, in my opinion (although if this is for a class, your professor's opinion is the only one that counts
). I didn't debug it or anything, but I can tell from looking at it that you don't have any major problems.
One thing about includes, though, and this may have been the source of your link problems before:
1. A small thing: Change the name of functions.cpp to functions.h. The way you are using it, it is really an include file, not a source file. Also. In your project you should make sure it is not being compiled as a source file. (It probably isn't because you'd be getting link errors if it was.
2. declare the getval functions as inline:
Code:
...
inline void getval(int *a){
...
inline void getval(float *a){
...
This will stop the link errors if you include functions.cpp (should be .h) in more than one place. You are getting around this now by including functions.cpp (.h) only once in main.cpp, but then you have to declare getval() manually in bank.cpp. This way you will be able to #include functions.h in both main.cpp and bank.cpp, which is the better way to do it.
--------
On the other hand, if you don't want to make the getval() functions inline, you could leave functions.cpp as is, and:
1. Add a functions.h that delcares the getval() functions (just declares them, no function body):
Code:
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
// ...comments...
void getval(int *a);
void getval(float *a);
#endif
2. Make sure functions.cpp is compiled as a source file, and remove the #ifndef FUNCTIONS_CPP stuff, which is header file stuff.
-------
I'm guessing that previously the bodies of the getval() functions appeared in more than one source file. This will cause link errors because a function with a particular name and set of parameters can only occur once in an executable. The exception to that rule is inline functions, which can appear multiple times.