No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
5 Posted Topics
I am trying to create a header file that contains several global variables. At the moment, the Globals header file looks like this: This is Globals.h #ifndef GLOBALS_INCLUDED #define GLOBALS_INCLUDED #include <string> std::string DRIVE="HELLO!!!!!"; #endif To go along with this, I have a cpp and h file the contain a … | |
OK, so I've learned through Google search that MinGW does not handle random number generation very well. Even when using a random generator seed based upon the time, it creates the same random numbers each time the program is run. This happens whether we used the old style rand, or … | |
I am trying to learn error trapping using the C++ commands try, throw, and catch. The problem I seem to be encountering is when I use new to declare an array. When the program throws an exception, don't I need to delete those arrays to prevent a memory leak? I … | |
Re: On line 12, the code should be: while (getline(in, line)) { The way you have it now, the string line is never assigned a value. You might also want to intialize line, just to guard against the possibility that the random contents of line equals deleteline at startup. | |
I have written the following function to accept a string from a csv text file that presumably contains a series of comma separated numbers. double comma_read(int &index, const string &input) // Reads a number from a comma delimited (csv) file // Returns first number after index-th comma // Then updates … |
The End.