Using strstream for ‘incore’ binary I/O
Question: Can I use strstream functions for incode I/O,i.e. writing to memory just as if it were binaryinput/output to a file? Answer: You can use it to do incode input
Question: Can I use strstream functions for incode I/O,i.e. writing to memory just as if it were binaryinput/output to a file? Answer: You can use it to do incode input
Question: Is it possible to read integers from a file as integers, or must I read them as strings and then convert them to integers? Answer: In C++ the streams
Question: I need to know what the class or function called “friend” is. My teacher explained it in class, but I don’t quite understand how to call it and declare
Question: What is the proper way to dynamically allocate a 2D array using the new operator?Here’s a code fragment:int num = 50;int **stuff;stuff = new int[num][num];My compiler (g++) returns the
Question: This is actually a simpler form of the real problem I am dealing with. I have a array of char like so:char name[20];Then, I try to put a string
Question: How can I provide my own predicate for the list::sort method in Visual C++ 5.0? The method appears to require that any function object passed must be derived from
Question: For a reference counted implementation, how is the operator+= member function coded? The function receives (const String & rhs) and returns String &. The returned String &
Question: Consider the following piece of code:#include /* C++ String class */static String s(“hello”);main() { // … your code s += ” world”; // …}Question: String class uses the new
Question: Suppose I’ve got the following class hierarchies:Surface_PlotContourSurface_Plot, child of Surface_PlotSurface_DataGridSurface_Data, child of Surface_DataSurface_Plot contains a Surface_Data object, ContourSurface_Plot contains a GridSurface_Data object.What is the most elegant way to arrange