Forum: C++ 1 Day Ago |
| Replies: 2 Views: 109 string resides in std namespace and you have to tell the compiler what namespace it's in. You have several options (use only one of the options listed below)
using namespace std; put that after... |
Forum: C++ 3 Days Ago |
| Replies: 2 Views: 128 Here is another way
if( file.is_open() )
{
int n, x;
float f;
file >> n >> x; // get first line
setM(n);
setX(x);
MatrixHandler data(n, n); |
Forum: C++ 3 Days Ago |
| Replies: 2 Views: 124 Yes because MFC doesn't know a thing about std::string. CString is the data type used by MFC to transfer strings from member variables to/from the MFC controls, such as edit box. There is a lot of... |
Forum: C++ 7 Days Ago |
| Replies: 1 Views: 197 Do you mean you read a c++ tutorial (you did NOT write it), and you want to know how to compile it? What compiler do you have? Each compiler is different. |
Forum: C++ 7 Days Ago |
| Replies: 2 Views: 165 Did you try deleting all object files and recompiling everything? If that doesn't work then post the offending source file. |
Forum: C++ Jun 22nd, 2009 |
| Replies: 2 Views: 347 Just a guess, but if you are trying to read the contents of a structure perhaps there are holes in the structure, such as the packing factor is something other than 1.
#pragma pack(1)
struct... |
Forum: C++ Mar 28th, 2009 |
| Replies: 4 Views: 385 The reason it closes is because cin left the Enter key '\n' in the keyboard buffer, and the next cin.get() just removed it. To fix this problem you need to flush the keyboard buffer after entering... |
Forum: C++ Mar 14th, 2009 |
| Replies: 2 Views: 219 integer digits are also characters. For example '0', '1', '2', ... '9' are all ascii characters just as 'a', 'b', ... 'z' are ascii characters.
Its quite easy to convert an ascii numeric... |
Forum: C++ Feb 4th, 2009 |
| Replies: 8 Views: 1,064 Freeky -- again, that code requires the use to hit the Enter key
Nishinoran: since your program is already using kbhit() when the program returns to the place to begin getting keys from the... |
Forum: C++ Oct 19th, 2008 |
| Replies: 6 Views: 452 Seek and thou shalt find. (http://www.daniweb.com/search/search.php?q=pointer+tutorial)
>>How do we know the type the pointer points?
You have to declare the data type when the pointer is... |
Forum: C++ Apr 1st, 2008 |
| Replies: 9 Views: 848 Been there, and done that (VietNam). I serverd 23 years in USAF (1962-1985) but I admit I was never shot or a POW. We have no greater respect than for our military and civilians now serving in Iraq... |
Forum: C++ Sep 12th, 2006 |
| Replies: 8 Views: 11,676 Here (http://www.cplusplus.com/ref/iostream/fstream/) is a link I find a useful reference. |
Forum: C++ Jul 26th, 2006 |
| Replies: 4 Views: 14,314 here is a pure c++ version that replaces the C-style char array with std::string and removes the tmp variable altogether.
From the looks of this function it must be just a code snippet of a larger... |