@gunnerfunner
- try and avoid using namespace std -
|
I know, I don't really use it anymore, but I thought that if someone read it, there was a chance of that person being like I was a few months ago. I hadn't understood why people kept writing "std::cout" and such, which was confusing for me.
- prefer std::string over char and std::vector over C-style arrays
|
Since Julien123 stated that he needed names that were at most 20 characters long, I supposed it needed to be like our teacher taught and requested us a whole year. Believe me, I don't ever use char arrays anymore, and I prefer the string all the time.
- the period after grade2 (line 9) should be replaced by a comma
|
Yea, I haven't noticed that one. Since it was a quick-writing, I didn't really look upon the code a second time.
- as a style issue I'd also suggest putting some spaces around the insertion << and extraction >> operators for better readability
|
As for this one, you're right for some or most people, but I, for one, can't see the operator in some cases, and since nobody told me in the beginning that I should leave spaces, I just went with this one.
On the bright side, I'm almost over with cout, therefore it won't be a main concern. Readibility will not be required.
- and the main point is that since the data is coming from 2 different files you need to make sure that ID in file#1 matches ID in file#2. for e.g. if you run your program against the 2 sample files I provided you'll find that data from file#2 is read against entries from file#1 indiscriminately, without first checking that the ID's match
|
I thought that it was the same order for both.
From what I thought, it was a good match with what I would do when writing information in files: first student, some data in first file, some data in second file. Since (if) it's not how I thought, then of course it's on me, because I am not a fan of seeing such meanings. I just improvise and create programs that don't have the requirement written that way.