-
File Handling in C
Hello friends,
I want to create an company,in that company ,i have to add employee's record and edit them ,i have to display the project assigned to employees.
Design
1.Company Name
1a.Employees
-Add record
-Delete record
-Search record
- Project assigned to employee
Project has
1. Project ID
2.Project Name
3. Staet Date
4.End Date
What is the best solution to solve the problem, help me plz.
-
Re: File Handling in C
1. how many fields are there in add record?
2. how to assign projects to employees?
3. do you want only project or employees, to display?
4. how many companies you have to do?
5. how to assign projects to employees i.e depends on qualification?
according to your question the system allocates one file for each employee,more memory required to store that details.
tell me the answers to the above queries and then i solve it.
-
Re: File Handling in C
[QUOTE=thyagi;22837]Hello friends,
I want to create an company,in that company ,i have to add employee's record and edit them ,i have to display the project assigned to employees.
Design
1.Company Name
1a.Employees
-Add record
-Delete record
-Search record
- Project assigned to employee
Project has
1. Project ID
2.Project Name
3. Staet Date
4.End Date
What is the best solution to solve the problem, help me plz.[/QUOTE]
Hmm..... this question is too vague to actually give an answer. So, let me ask a few questions so that it will help you clarify your question better.
1.
Looks like you are creating some sort of a database of records. So, why not use a commercial database to store and query records??
2.
If you do not want to use a commercial database, then what is the platform you are using?? I.e. operating system, language, etc
3.
A design for any problem needs to address a few things:
- how many elements need to be stored??
- what data structure to use to store the data??
- what algorithm to use to search the data
- what is the search speed required??
- Is parallel access to the data necessary??
- What is the % of reads v/s writes to the data??
Without having an idea about the above, the question is really vague.
-
Re: File Handling in C
hi
i think , you are trying to build a C/C++ program to handle a database, right? then
are you expecting only one company? then
just create 2 binary file to handle database, one is for employees data and another one is for Project details, you can link them together with having project Id in employees record.
and you must also have company Id in employee recod.
you can access records by using fread() and fwrite() in C
If you want more than 1 company, you must create one more file for company details.
[B][COLOR="DarkOrange"]Jaya
[/COLOR][/B]
-
Re: File Handling in C
i want file handling in C with the same query and same ideas i have put of