Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

matt_j

Need some help with this

This topic is 5750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What is wrong with this. It crashes the program. I want to read data into a structure or variable: assume: a FILE is open called "data" a "datafile" class exists as df -------------------- BITMAPFILEHEADER df; df->readdat(&bminfo,sizeof(BITMAPFILEHEADER)); ----------------------- void datafile::readdat(void *buf, unsigned int len){ fread(&buf,len,1,data); }

Sub-Terra Software - High quality free games and applications
matt_j@shaw.ca
subterrasoft@hotmail.com

Share this post


Link to post
Share on other sites
Advertisement

void datafile::readdat(void *buf, unsigned int len){
fread(&buf,len,1,data);
}

shoule be

void datafile::readdat(void *buf, unsigned int len){
fread(buf,len,1,data);
}

(Note the lack of the &)

Edit: Just tested it. Strange, MSVC doesn't catch the error of casting a void** to a void* ...




[edited by - Evil Bill on December 24, 2002 3:01:10 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Evil Bill
Strange, MSVC doesn''t catch the error of casting a void** to a void*
Any pointer can be implicitely converted to void*, it''s not an error.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!