If you are writing a single-threaded program, use Sleep fn to wait a specified number of milliseconds.
If you are writing a multi-threaded program do not use Sleep as it could cause all threads to sleep, rather, use the WinNT timeSetEvent() fn.
Your code is a bit unclear, but one reason for the "ambiguous" error is that the compiler thinks the cout command is being multiply defined. This can happen if header files are included more than once.
Unlike Java, the header file is where the class definition is declared ( a bit like...
THe header file is used to declare what tyhe class is and what methods are available. The cpp file is used to instantiate the class; that is write the code for each of the methods declared in the header file.
// SApplication.h
#include <iostream.h>
#include <string>
using namespace std...
Your problem is that the count variable is inside the while loop, so each iteration re-initialises it back to zero.
your code ...
while (!DataIn.eof()) // While more entries
{
int count;
DataIn.read((char*)&entry,sizeof(DataIn));
...
}
should read
int count = 0;
while...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.