I'm trying to convert pszOutBuffer
which is created below into a const char *
So to do this I'm attempting to use sprintf
to create a char
called buffer
and then finally getting the buffer
's c_str()
. But buffer
is thowing the error "Expression must have a class type"
if( !WinHttpReadData( hRequest, (LPVOID)pszOutBuffer,
dwSize, &dwDownloaded ) )
printf( "Error %u in WinHttpReadData.\n", GetLastError( ) );
else
printf( "%s", pszOutBuffer );
char buffer [4096];
sprintf(buffer,"%s",pszOutBuffer);
returnval = buffer.c_str();