I am doing testing and below is a piece of code that is giving me an error : Unhandled exception at 0x00956faa in myprogram.exe: 0xC0000005: Access violation reading location 0xcccccccc.
If any more infor is required let me know. I know its something to do with memory accessing
please help me get rid of the program crashing because of above exception
Thanks
Edit: pl check below for helping for error solving thanks
Why are you only setting part of your buffer to zero?
Did you try running the program with your debugger? The debugger should be able to tell you exactly where it detected the problem and should allow you to view the variables at the time of the crash.
Since you posted so little code I can only guess, but with that guess I would say that instead of passing a pointer to your sdBuffer you were passing a pointer to a pointer to your sdBuffer. What do the variables look like in your debugger?
Also why are you using malloc() instead of new/delete?
Hi what other part of code is required let me know I am new to this and interning at a company so not able to solve also any other debugging tips or some advice will be appreciated
thanks for the reply
Hi what other part of code is required let me know
Since you seem to be getting a segmentation fault, a small complete program that illustrates the problem would be helpful.
Have you run the program with your debugger? The debugger should tell you exactly where it detects the problem and you should be able to view the variables at the time of the crash.