954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

please help! how can I load a file in C?

Please I need some help in C. I have a file with ".dat" format, how can i load it in C, into a variable, so that I can use the data for some math calculations later on?
thank you.

Cbeginner_us
Newbie Poster
18 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 
stupidenator
Junior Poster
192 posts since Mar 2005
Reputation Points: 18
Solved Threads: 4
 

You have to know the file format before it is useful to you. The link that stupidenator posted will show you how to use the FILE to read a file, but that is useless if you don't know the details of what the file contains.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

thx guys it did help me!

Cbeginner_us
Newbie Poster
18 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

well actually Ancient Dragon, you are right, my file contains some data collected from the output of an Analog-to-Digital converter, I need to load these data and try to do some mathematical calculations to get some results. Can u help me with that?

Cbeginner_us
Newbie Poster
18 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

>>Can u help me with that?
Probably, but not without knowing how the data was written :)

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You