I'm trying to work out how to break up my assignment, I know how to break into 3, as per usual main.cpp driver.cpp and header, but what if I want to add more .cpp files that do different things? do they all have ti implement the header and class myClassName?
I wanted to add another class/ or simply file that dealt with cmd line args, and setting / getting various different parameters. seems a bit silly to have this in main or my driver class as it is a lot of code.
-----------------------
Additionally I only just discovered this page http://cplusplus.com/src/
And went to have a look at the source for notepad, I didn't even have a good look only got to line 20... but the fact that brackets were all over the place, indentation was obscene, and the guy didn't even return an integer(or return anything) from int main().... seems kinda silly to me. Why have source that is retarded?
anyone have any ideas on the adding extra classes/files ? because I have 2 files both using the same class name and header, the object files compiled fine but when trying to compile main it's giving me error :
a2Main.cpp In function int main(int,char**):
a2Main.cpp:61: error: request for member 'checkArgs' in 'ss', which is of non-class type 'StringSort ()()'
a2Main.cpp:62: error: request for member 'runApp' in 'ss', which is of non-class type 'StringSort ()()'
void main() is non-standard, but I'm guessing this program was written before the standard said it
shall be "int main()". Given that the output mechanism works by directly accessing video RAM through
far pointers (which is what shows its age), I'd be surprised if it still ran.
I have no idea how you are trying to break things up or what you are even trying to break up.
All I can say at this point is that each symbol should be declared once and only once, in one header file.
Nevermind, my texts don't talk about friend classes, never even seen it before.... But handy none the less :D Least I won't have to duplicate so much code now.
All I can say at this point is that each symbol should be declared once and only once, in one header file.
so in other words, don't create multiple headers for each class? I will try to explain a bit better.
basically I have my main class by main I mean (int main(), filename: a2Main.cpp) which simply deals with command line arguments and then creates an object of class StringSort(which is a separate file called a2.cpp) and calls StringSort's runApp() method.
Because the dealing with command line arguments in int main is about 100 lines of code, I wanted to stick into a different file, whether or not this has to be a different class has no bearing I don't mind, but I am unsure which.
I don't get it, I thought I could do that, like the header file above ^^, but when I try and compile the StringSort methods in object file it complains about class CheckArgs in the header file.