   File I/O - Read parts from the line as float/int etc
  Is that possible?I.e.score=123.03How do I store 123.03 as a float?   
  That depends on what language you are using.   ;  C++, as I always seem to forget to write...   ;sscanf;  Thanks a lot! :D   ;Quote:Original post by DungesscanfPlease, please, please do not use this function. It is unsafe, vulnerable to certain types of security exploits, and very fragile when working with malformed inputs.The correct solution in C++ is to use a stringstream object.   ;  You know how you use operator>> to read in data from std::cin, and it automatically does the appropriate thing, according to the type of the variable you're reading into?That works for any kind of input stream. For file data, you use an fstream.For strings that are already in memory (std::string objects), there's another type of stream - std::stringstream - that you can wrap around the string. It reads from (or writes to, according to the mode) the string as if it were a file, and also provides a .str() member function that you can use to retrieve the underlying string (which is useful for formatting floats etc. as text and then doing someting else with the text, instead of just feeding it directly to std::cout).The std::stringstream class (and derived classes std::istringstream and std::ostringstream - they just set input or output mode, analogous to std::ifstream and std::ofstream) is provided by the <sstream> header.   