[Dev-C++] I´d like to know your hints about file manipulations
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
From: André M. B. <and...@su...> - 2008-06-21 18:39:35
|
Dear users, I like this list because we can ask questions regarding not only about Dev-cpp, like the one that I present to you now. Consider the following restrictions: -only ANSI-C commands; -not C++; -for file manipulation, only the following commands: fopen(), fscanf(), fgets(), feof(), and fclose(); Inside this scenario, people can easly work read and write files containing integers and floating point numbers. Situations like names, sex (male/female), option (yes/no), etc, can be replaced by integer codes. My question is: What is your style to work with strings, i.e., names for example: for a program that expects to read a name from a file (with spaces, variable size, etc), do you previosly indicate a fixed number of characters (40, for example) and use fgets twice (to read the 40 characters and read the '\n')? Thanks a lot in advance André |