Hello All, well this is my first post after a while of inactivity.
I have run into a problem. I have an assignment for school, but when I debug my program using Dev C++(BloodShed) it give me a segmentation fault.
I am reading from a file that looks like this:
0001:Satriani:Joe:6:38.0 0002:Vai:Steve:1:44.5 0003:Morse:Steve:10:50.0 0004:Van Halen:Eddie:3:25.75 0005:Petrucci:John:8:42.25 0006:Beck:Jeff:3:62.0
i read from the file using this:
fscanf(in, "%[^:]:%[ ^:]:%[ ^:]:%d:%lf", empNum, lName, fName, &pGrp, &hrsWorked);
* Not Sure weather this is causing the problem or not.
I have an array that contains pay rates.
I want to do this:
rate = payRates[pGrp-1];
While debugging it gives me a segmentation fault error and high lites this line. Is it possible to do what I want to do? If it is not is there a way that I can achieve the same result?