0

hi, i m mohan
i hv problem related to file handling.
i hv two txt files emp.txt and dpt.txt.these are following
emp.txt

1111 Tata 1000 12354663
1112 Suresh 1001 -46436433
1113 Hari 1002 46546735
1114 Ramaji 1000 -54651324

where 1111 is a empId,Tata is EmpName,1000 is DeptCode
and 12354663 is Ref.No.and same for all lines

dpt.txt


1000 MMM
1001 NNN
1002 PPP

where 1000 is dept code and MMM is DeptName and same for all lines

i want to write a code so that output will show the dept name and no. of employee
in that dept in the tabular form. out should show like following
name of dept no. of employee
============ ================
MMM 2
NNN 1
PPP 1

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by death_oclock
1

>i want to write a code so that output will show the dept name and no. of employee in that dept in the tabular form.

Start doing it, and stop wasting your time posting the assignment.
Show us your efforts.

Votes + Comments
Thats the spirit :)
0

If you don't know how to open the file, read about fopen, fclose, etc. If you don't know how to read the information, read about fgets, fread, sscanf, etc.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.