Hi, is there anyway to read an entire file and print in on screen? file consists of strings and integers!
Hi, is there anyway to read an entire file and print in on screen? file consists of strings and integers!
Yes, fgets.
Code:while(!asleep) { sheep++; }
There are examples on the bottom of these pages:
fgetc
fgetc, fgetwc, _fgetchar, _fgetwchar (CRT)
fread (which would be better for those structs you have been working on)
fread (CRT)
Fact - Beethoven wrote his first symphony in C
hey thanks for the info but im still not sure how to use it :/ would the fgetc allow me to search the file and sort it ??
What I can gather from you is that you want to sort the structs which you created in the other thread.
What you need to do is use a linked-list. The title of your other thread did have the word "linked-list", but you never ended up actually doing a linked list.
The way you need to go forward with your program (in my opinion) is to forget about saving the data until you can put it in a linked list. Once you are there, you can search and sort very easily.
Fact - Beethoven wrote his first symphony in C
well that was my plan fro the beginning! but i have no idea how to start a linked list! help!!
I would start here: Linked Lists in C Tutorial - Cprogramming.com
Post any questions you may have.
Thanks alot for all the help guys