C++ exception what to do?

Exception occurred at 0x78F6F6E0 (ucrtbased.dll) in Parser2.exe: 0xC0000005: access violation when reading at address 0x00000000.

main.cpp
#include "htmlgrab.h"
#include <urlmon.h>
#include <iostream>
#include <fstream>

int main()
{
try
{
 char webAddress[256];

 std::cout << "Enter webPage url >" << std::endl;
 std::cin >> webAddress;

 HtmlGrabber htmlgrab;

 char* sss = htmlgrab.GetHtmlText(webAddress);

 std::cout << sss;
}
 catch (const std::runtime_error& e)
{
 std::cout << e.what() << std::endl;
 return -1;
}
 return 0;
}

htmlgrab.cpp
#include "htmlgrab.h"

HtmlGrabber::HtmlGrabber()
{
}

HtmlGrabber::~HtmlGrabber()
{
}

char* HtmlGrabber::GetHtmlText(webAdders char[256])
{

 char FileName[70] = "result.html";


 HRESULT hr = URLDownloadToFile(NULL, webAdders, FileName, 0, NULL);

 if (hr == S_OK)
{
 std::cout << "Success!\n";
 std::ifstream fin(FileName);
 char szBuff[2048];
 while (fin.getline(szBuff, 2048))
{
 std::cout << szBuff;
 return szBuff;
}
}
else
{
 throw std::runtime_error("Fail getting html");
}


 return 0;
}

htmlgrab.h
#pragma once
#include <urlmon.h>
#include <iostream>
#include <fstream>
class HtmlGrabber
{
public:
HtmlGrabber();
~HtmlGrabber();

 char* GetHtmlText(webAdders char[256]);
 char webAddress;

};
April 3rd 20 at 17:20
1 answer
April 3rd 20 at 17:22
The issue is resolved. Needed to put multibyte encoding.

Find more questions by tags C++