2008. 8. 18. 20:35
[VC - 넘당연한거 1 ]친절한 MS~ 진짜~ Debug Library , Debug Error Stack around the variable '변수' was corrupted. 용-ILE/LNAG-C/C++2008. 8. 18. 20:35
2008 08 fs~~ http://suite.tistory.com/
지역변수 사용후 스텍정리를 하다가 죽어서? 나오는에러 같다~ 변수 이름까지 잘찍어준다
코딩 에러 상황
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char tmp_s[2];
strcpy(lenth_2data,"12");
strcpy(tmp_s,lenth_2data);//<- 여기서죽는다 두글자하고 + '\0' 만큼 하나더 늘려준다
tmp_s[1]='\0';
num=atoi(tmp_s);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
======>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
char tmp_s[3]; //
strcpy(tmp_s,lenth_2data);
tmp_s[1]='\0';
num=atoi(tmp_s);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
변수 범위를 잘 확인하자~~
뭐이런 예말고 다른 상황에서도 잘 확인~
넘 기본이군~~~