if you want to read all the lines in the file then make line 26 a while statement, not an if statement.
strEmployeeCategory == "J")
You can't do that with character arrays. You have to call strcmp() to compare two character arrays like this
if( strcmp(strEmployeeCategory, "j") == 0)
strcmp() returns 0 if the two strings are identical, or something else if they are not the same. If all you need to do is check the first character in strEmplooyeeCategory then you can use this instead:
if( strEmployeeCategory[0] == 'j')
Ancient Dragon
Achieved Level 70
32,115 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68
@AD strEmployeeCategor is an STL string not a char[]. I think the issue he is having is that he is trying to compare floats and he has one of those .00000000000001's hanging around.
NathanOliver
Posting Virtuoso
1,513 posts since Apr 2009
Reputation Points: 269
Solved Threads: 277
Skill Endorsements: 3
@AD strEmployeeCategor is an STL string not a char[].
You are right, I was looking at strEmployeeName
why is nNoofhoursPerWeek declared as a float instead of int?
Ancient Dragon
Achieved Level 70
32,115 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 68