I am an experienced Pascal programmer but I'm new to C++. I'm trying to avoid asking stupid questions but every book, tutorial, FAQ, etc I have found always assumes that I know this stuff. Please help me if you can!
1. What does the underscore (_) and double underscore (__) in front of a function and/or variable name mean?
2. What is the difference (if any) between these two lines of code? I'm specifically talking about the placement of the *
int Read(unsigned char *buff);
int Read(unsigned char* buff);
3. In the following function if the IF condition evaluates to true will that cause a memory leak with temp?
int FileChunk::Read(unsigned char *buff,int maxNum)
DWORD numRead = 0;
//allocate a buffer big enough to hold the users data plus the header
unsigned char *temp = new unsigned char[maxNum + sizeof(cid)];
//read in the specified number of bytes
if (numRead = GenericFile::Read(temp,maxNum + sizeof(cid)))
... //misc code
//return the number of bytes read
I would appreciate any help you can provide. Thanks!