C++ Access Violation Reading Location 0Xcccccccc, Access Violation Reading Location 0Xcccccccc

I have upload the complete solution (.sln). You can download the code from the following link:

https://www.dropbox.com/s/avsts0xqh72pnbc/http_sample_using_C.zip?dl=0

Further, I have tried by signing the URL using C# code and then try that signed URL in C++. but found the same error. On the other hand, the C# code executes successfully.

You are watching: C++ access violation reading location

Have you actually stepped through your code to check what is causing the use of an uninitialized pointer?

David Wilkinson | Visual C++ MVP

*

*

I am facing issue while executing C++ code. Following is the sample code:

http::client client; http::client::request request(signed_URL); http::client::response response = client.get(request); std::cout It through error on line:

–> std::cout

“Access violation reading location 0xcccccccc” means that you are trying to use uninitialized memory.

The error is presumably in code you have not shown, inside the body() function.

What does this function do? In particular, what is its return type?

David Wilkinson | Visual C++ MVP

Friday, April 24, 2015 9:40 AM

All replies

*

*

0
Sign in to vote

I am facing issue while executing C++ code. Following is the sample code:

http::client client; http::client::request request(signed_URL); http::client::response response = client.get(request); std::cout It through error on line:

–> std::cout

“Access violation reading location 0xcccccccc” means that you are trying to use uninitialized memory.

See more: Trey Songz Can’T Help But Wait, Can&#39T Help But Wait By Trey Songz

The error is presumably in code you have not shown, inside the body() function.

What does this function do? In particular, what is its return type?

David Wilkinson | Visual C++ MVP

Friday, April 24, 2015 9:40 AM

*

0
Sign in to vote

body() is a function inside Boost::network::http lib, body wrapper

Please, note that if i try to get response from any other site e.g. google it works fine. Following is the code that works:http::client client;http::client::request request(“http://www.google.com.pk”);http::client::response response = client.get(request);std::cout

You seem to be assuming that we are familiar with the Boost::network::http library. In my case at least this is not the case. You are not even showing us how the various bits of code you are posting fit together.

What you need to do is step through your code in the debugger and find out what is going wrong. Same as with any other piece of code.

See more: Discovering Our Past A History Of The United States Pdf, (Pdf) Free 0076596931 Discovering Our Past

David Wilkinson | Visual C++ MVP

Friday, April 24, 2015 11:47 AM
1
Sign in to vote

I have upload the complete solution (.sln). You can download the code from the following link:

https://www.dropbox.com/s/avsts0xqh72pnbc/http_sample_using_C.zip?dl=0

Further, I have tried by signing the URL using C# code and then try that signed URL in C++. but found the same error. On the other hand, the C# code executes successfully.

Have you actually stepped through your code to check what is causing the use of an uninitialized pointer?

David Wilkinson | Visual C++ MVP

Saturday, May 2, 2015 9:42 AM

Published

Leave a comment

Your email address will not be published. Required fields are marked *