Files and Streams
-
An extreme novice question,... I have been searching the Internet, mostly at the Microsoft Developer Network site and, of course, here. Undoubtedly, you guys have all gone through this in developing applications. Is there a comprehensive reference for File Management using streams, and/or strings, and/or alpha-numeric character arrays? I am envisioning writing a complex mathematical modeling program and would like to structure data files, for both diagnostic reasons and as initial data fields for additional components. Thanks for any suggestions,...
-
An extreme novice question,... I have been searching the Internet, mostly at the Microsoft Developer Network site and, of course, here. Undoubtedly, you guys have all gone through this in developing applications. Is there a comprehensive reference for File Management using streams, and/or strings, and/or alpha-numeric character arrays? I am envisioning writing a complex mathematical modeling program and would like to structure data files, for both diagnostic reasons and as initial data fields for additional components. Thanks for any suggestions,...
My STL articles between them offer a decent overview of using iostreams. Christian NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
-
An extreme novice question,... I have been searching the Internet, mostly at the Microsoft Developer Network site and, of course, here. Undoubtedly, you guys have all gone through this in developing applications. Is there a comprehensive reference for File Management using streams, and/or strings, and/or alpha-numeric character arrays? I am envisioning writing a complex mathematical modeling program and would like to structure data files, for both diagnostic reasons and as initial data fields for additional components. Thanks for any suggestions,...
Still the best book on all things C++ IMHO is Bruce Eckel's "Thinking in C++", available for free download at http://www.mindview.net/ (the version in the bookshops is outdated). Bruce includes a comprehensive discussion of streams and streams vs files. However, from your post I am not sure that your issue is one of streams vs files. As a C++ programmer, you should use streams. Period. Now, when you say "structure data files", that's where I think you should be talking XML. Which kind-of voids the question of streams vs files: because you shouldn't reinvent the wheel, you should use a readily available XML engine (such as Microsoft's free MSXML4, but many others exist, too). These engines have facilities to fetch and persist XML data, including the storage in a local file. Bernd
-
Still the best book on all things C++ IMHO is Bruce Eckel's "Thinking in C++", available for free download at http://www.mindview.net/ (the version in the bookshops is outdated). Bruce includes a comprehensive discussion of streams and streams vs files. However, from your post I am not sure that your issue is one of streams vs files. As a C++ programmer, you should use streams. Period. Now, when you say "structure data files", that's where I think you should be talking XML. Which kind-of voids the question of streams vs files: because you shouldn't reinvent the wheel, you should use a readily available XML engine (such as Microsoft's free MSXML4, but many others exist, too). These engines have facilities to fetch and persist XML data, including the storage in a local file. Bernd
Christian Graus and Bernd, THANKS! Excellent suggestions from both of you, I really appreciate it. Very helpful. Christian, your articles are EXCELLENT (exactly what I was looking for):-D, and Bernd, I hadn't even thought of XML, but, it's a great idea. I suspect you both saved me alot of time exploring inadequate approaches to the problem.