Calculate Salary.

Posted 21 March 2013 - 06:32 PM

A given input file contain Name of the employee and salary of current month. There is a single space between the name and the salary. Name and salary can not contain spaces. Calculate the total salaries of the employees. Create an output file and write the total salary in that file.

Replies To: Calculate Salary.

Re: Calculate Salary.

Out of curiosity, what lead you to choose to use strtok() instead of some other technique for parsing your file?

Back on topic: Are you sure your file is space delimited and not tab delimited?

I just confirmed: your file is tab delimited. This is assuming that you just cut and pasted from your input file to this forum. When I tried to edit your post, I saw that all the salaries were nicely lined up which would indicate that your file is tab delimited.