Reading from file and displaying in edit box

Hello Experts,
Ok here's what I am trying to do:
I have a text file which has a row of readings for date, time, tempeature, rain, windspeed.
What I am doing is designing a GUI where a user can click a button and get latest temperature to appear in an edit box.(the latest reading is always in the same file).

For testing purposes i have a file just containg a number representing temperature and when I click the button the ascii value for the number in the file appears. Is there a function that will covert ascii to char or int?

Also my C++ programming skills are nothing special, I am just using fgetc to read from the file. If I want to have another button to say get curent rainfall or windspeed. How do I actualy navigate my way around the file. assuming its structured like:
date        time         tempeature          rain             windspeed
What is the difference in fgets and fgetc? is it simply to read a string (1 whole line ) and character( 1 digit)?

Would it be easier if i skipped a line between each reading instead of using tabs? Its in this format because its being dumped into a database and it is supposed to be in this form. i was hoping I could use the one file for dumping to database and viewing the latest rading from the GUI.  

Thanks for any help.
fr
fr_cassidyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Amritpal SinghCommented:
for reading file use a structure

struct myrecord
{
     char date[SIZE]
     char time[SIZE]
     .....
};
struct myrecord r;
FILE *fp;
fp = fopen("filename","r");
while ( fread ( &r, sizeof ( r ), 1, fp ) == 1 )
    printf ( "\n%s %s %s", r.date, r.time, .. ) ;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.