I was reading through WinHttp functions and tried executing an example code from MSDN. The first line of the code
LPSTR pszData = "WinHttpWriteData Example";
throws an error when I execute.
Error C2440 'initializing': cannot convert from 'const char [25]' to 'LPSTR'
I have already included the required header files and libraries of Windows and Strings.
#include <winhttp.h>
#include <windows.h>
#include <string>
#include <strsafe.h>
#pragma comment(lib, "winhttp.lib")
I don't see any problem here. But why do I get an error?
When I searched for problems related to that program, people have executed the same program and it didn't throw an error for this statement or anything related to this.