Skip to main content
GameDev.net gamedev.net
🔒 Locked

fscanf

Started by penetrator Aug 15, 2003 at 10:08 AM 1 replies 550+ views
Original Post
penetrator
penetrator
I''d like to read floats (they are separated from comma) from a text file which contains also some characters that i want to skip like { } There is a way to skip those chars ?
666_1337
666_1337
read the whole file then replace all "unwanted" characters with spaces...
then tokenize the string into pieces and use atof to convert
our new version has many new and good features. sadly, the good nes are not new and the new nes are not good oo
Kuladus
Kuladus


say the format is...

{0.56,78.6,90.0}


then all u have to do is...

float float1, float2, float3;

fscanf(file, "{%f,%f,%f}", &float1, &float2, &float3);

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.