d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > C Small Program
Add Reply New Topic New Poll
Member
Posts: 165
Joined: Jul 16 2012
Gold: Locked
Trader: Scammer
Warn: 10%
Jan 7 2013 05:42am
I really need help asap in this C program

Quote
The program has a simple database support.

As a database file using a text file. Its structure is as follows:

name1
service1 *lenght of the employee work (f.e 2 years) etc.*
name2
service2
NAME3
service3

....

The program is able to add and display employee workers - in addition the program should allow for the statistical activities (calculation of the average length of service, finding the oldest employee). Additionally, the program should make it possible to edit and delete employees.

The program should use a function in the place of operations (for example a function for adding an employee, display, etc.)


Im bad in C, i might help out with html,php,sql as a help. Cant offer your the gold in here sadly. I hope someone gives me a helping had.

This post was edited by kavvson on Jan 7 2013 05:43am
Member
Posts: 14,235
Joined: Apr 20 2007
Gold: 15.00
Jan 7 2013 06:12am
we will help you, but we won't write your homework
post your code and/or questions, and you will get answers :)
Member
Posts: 165
Joined: Jul 16 2012
Gold: Locked
Trader: Scammer
Warn: 10%
Jan 7 2013 06:22am
Im rly bad at c

Quote
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *plik;
int c;
if(argc != 2)
{
printf("Blad podaj nazwe pliku !!!\n");
exit(1);
}
plik = fopen(argv[1],"r");
printf("Odczytuje zawartosc pliku: %s\n\n",argv[1]);
if(plik == NULL)
{
printf("Blad otwarcia pliku ...\n");
exit(1);
}
while((c=fgetc(plik)) != EOF)
{
printf("%c",c);
}
printf("\n");
fclose(plik);

}


I just know php :(( I dont know how to operate on the file now;s

This post was edited by kavvson on Jan 7 2013 06:29am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll