سلام دوستان
من تو محیط Visual Studio برنامه مینویسم به زبان C++ (Console)
یه مشکلی که برام پیش اومده این هست
این کد رو نگاه کنید
برنامه اجرا میشه و به درستی کارش رو انجام میده منتها وقتی به قسمت detele میرسه این ارور رو میدهکد:int _tmain(int argc, _TCHAR* argv[])
{
char *b = new char[1];
cin>>b;
cout<<b[2];
cin.ignore();
cin.get();
delete [] b;
return 0;
}
میخواستم بدونم مشکل از کجاستکد:---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!
Program: ...\My Documents\Visual Studio 2008\Projects\test\Debug\test.exe
HEAP CORRUPTION DETECTED: after Normal block (#152) at 0x003493E8.
CRT detected that the application wrote to memory after end of heap buffer.
(Press Retry to debug the application)
---------------------------
Abort Retry Ignore
---------------------------
ممنون