ok so i am doing a homework with random access files .
I created a class with all the variables and made the implementation. Now i am trying to create a .dat file and create 50 blank records in it...
Type: Posts; User: Shadow20
ok so i am doing a homework with random access files .
I created a class with all the variables and made the implementation. Now i am trying to create a .dat file and create 50 blank records in it...
hello,
i am doing an assignment and in it, I want to ask the user for two numbers( a row and a column) but it should be in the format of x:y
where x is the row and y is the column.
My question,...
Thank you very much, will see if i can use it, it looks a little more complex than i expected:)
Hello, i am writing a program and i want to read from a file and create another and write to it, i already have most of it figured out but my problem is the file path, i cant create it to C:\ as it...
alright, everyone thanks for all your help, I am gonna see if i can get something done and see how it goes. If i get stuck, guess i will come back and ask away:)
Well i am not really sure, but i made an error, no $ sign is supposed to be there, sorry:(
i used a struct to do a payroll system last time, so i figured it was as you said. I am a bit confused...
...
how would you do that? could you give an example if possible?
hmm, would it be something like making a struct and using the fields you want from the struct and storing them in an array and using...
Hello, I am in the process of starting to write a program, already have the design and other details fairly figured out but i am doing a extension to a payroll system where i take the data from the...
ah thanks, i didnt realize the ampersand was there. I fixed it.
wow, didnt realize it would be such a simple answer... i tried it and it worked perfect for the writing to the file correctly replacing the records but had some problems getting the printing to the...
hello, i previously posted here asking about print to screen issue, i got help and i thought it worked cuz i run it and it worked flawlessly and then now i add some stuff to it and now everything...
I think i got what you meant with that explanation. I finally got my program to work how i want it to atlast, it doesnt seem to happen very often:D
You are the man!:cool:
thanks for your help and...
Adak, Thank you very much:D
just a few questions then i am good on my own i think
1) why was string.h needed to be included in this example?
2)in your example why was the variable junk and fgets...
there is only two lines, its how i wrote the program to create a formatted file with the headings then create a record.
number First name Last name id no. pay rate year ...
yes, i made the file with another part of the program then read from it in this function. the file is named payroll.txt
not sure what you mean by input file, sorry
but here is the first 3 lines from the edit function
int editchoice=1;
//initialize file pointer to edit files
FILE *writeptr;
...
I run it and it output 8.. i temporarily removed my printf statements to see it clear
i placed it right after the fscanf statement.
I added in the ampersands in the fscanf here:
fscanf(writeptr, "%10d%15s%15s%12d%12.2lf%8d%12.2lf%12.2lf%12.2lf%12.2lf%14.2lf%12.2lf\r\n" , &employee.num, employee.first_name,...
but i dont have any problems with the numbers its the strings i have a problem with... the strings wont output to the screen.
ok will add the & to the fscanf() thanks.
ok which number input? i have one before the employee.num, thats the only one necessary right?
i saw in a C book i have, they use the scanf() like that with all the minuses,will try removing them...
hello, i am writing a payroll system or a attempt at it anyway. i have put in records in the system via a addrecords function then when to edit it, i want the user to be able to see which record they...