ÉîÈëC/C++Ö®»ùÓÚCheckStackVarsµÄ°²È«¼ì²é£¨VS2008£©
×î½üһֱæ±ÏÒµµÄÏà¹ØÊÂÇ飬¼ÓÉϹ¤×÷£¬×ªÑۼ䣬ÓÖµ½Ôµ×ÁË£¬Ö®Ç°³ÐŵµÄÿÔÂһƪ²©ÎÄ£¬Ç°¼¸Ìì¾ÍÒ»Ö±ÔÚÑ°ÕÒµ½µ×Ҫдʲô£¬½üÁ½ÌìÓÖͻȻ·¢ÏÖÓкܶණÎ÷¿ÉÒÔд¡£±¾Æª¾ÍÏÈÑÓÐø֮ǰµÄһƪ»ùÓÚCookieµÄ°²È«¼ì²é»úÖÆ£¨ÉîÈëC/C++Ö®»ùÓÚCookieµÄ°²È«¼ì²é£¨VS2005£©£©À´½éÉÜÏÂÁíÍâÒ»ÖÖÔÚDEBUG°æ±¾Ïµİ²È«¼ì²é£¬Ò²¾ÍÊÇCheckStackVars¼ì²é£¬»°²»¶à˵£¬Ö±½Ó½øÈëÕýÌâ¡£
ÔÚVS2008Ï£¬º¯ÊýµÄÕ»¿Õ¼äÀïÈç¹û´æÔÚÊý×飬¾Í»á×Ô¶¯¼ÓÉÏCheckStackVars¼ì²é£¬¹ËÃû˼Ò壬¾ÍÊÇÓÃÀ´¼ì²é¾Ö²¿Êý¾ÝÊÇ·ñ·ÃÎÊÔ½½ç¡£Ïà¶ÔÀ´Ëµ£¬ÕâÖÖ¼ì²éÖ»ÄÜÆðµ½Ò»¶¨µÄ×÷Ó㬲¢²»»áËùÓÐÔ½½ç·ÃÎʶ¼Äܼì²éµ½£¬¸ù¾ÝºóÃæµÄÔÀí½éÉÜ»áÁ˽⵽Õâµã¡£¼ÈÈ»ÊǼì²é¾Ö²¿µÄ£¬ÄÇôÔÚº¯ÊýÄÚ¶¨ÒåµÄstaticÀàÐÍÊý×é»òÕߺ¯ÊýÍⲿµÄÈ«¾ÖÊý×é²¢²»»á²ÉÓô˼ì²é£¬¼ÈÈ»ÊǼì²éÊý×飬ÄÇôÈç¹ûº¯ÊýÄÚûÓоֲ¿Êý×éʱ£¬´Ë¼ì²éÒ²²»»á´æÔÚ¡£
Ê×ÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó£¬ÑéÖ¤Õâ¸ö¼ì²éµÄ´æÔÚ£º
void TestVars( void )
{
int bf = 0xeeeeeeee;
char array[10] = { 0 };
int bk = 0xffffffff;
strcpy( array, "masefee" );
}
int main( void )
{
TestVars();
return 0;
}
ÔÚÕâ¸öÀý×ÓÖУ¬´æÔÚÒ»¸öÊý×éarray£¬ÕâÀï¿ÌÒⶨÒåÁËÁíÍâÁ½¸ö±äÁ¿£¬ÓÃÓÚ¿´ÕâÁ½¸ö±äÁ¿ÓëÊý×éarrayµÄÄÚ´æ·Ö²¼Çé¿ö¡£ÕâÑù¾ÍÄÜÇåÎúµÄÁ˽⵽CheckStackVarsÕâ¸ö¼ì²éµÄÔÀí¡£È»ºóÀ´¿´¿´DebugÏ£¬TestVarsº¯ÊýÄÚ²¿µÄ3¸ö¾Ö²¿±äÁ¿µÄÄÚ´æ·Ö²¼Çé¿ö¡£¶Ïµã´òÔÚstrcpyÕâ¾äÉÏ£¬·Ö²¼ÈçÏ£º
ff ff ff ff cc cc cc cc cc cc cc cc 00 00 00 00 00 00 00 00 00 00cc cc cc cc cc cc cc cc cc cc ee ee ee ee
bk array &nbs
Ïà¹ØÎĵµ£º
ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......
ÓÉÓÚLINUX
CûÓжÔ×Ö·û´®×Ó´®Ìæ»»¹¦ÄÜ,ËùÒÔÎÒ×Ô¼ºÐ´ÁËÒ»¸östr_replaceº¯Êý,ʵÏÖÁË×Ö·û´®Ìæ»».
Çë´ó¼Ò²Î¿¼.
/*
* FUNCTION : str_replace
*
ABSTRACT : replace child string in a string.
*
PARAMETER &nbs ......
±¾ÎÄÌÖÂÛÁËC³ÌÐòµÄÍⲿ±äÁ¿ºÍº¯ÊýµÄһЩÐÔÖÊ£¬½áºÏʵ¼ÊµÄ±à³Ì£¬¸ø³öÁËʹÓÃÍⲿ±äÁ¿ºÍº¯ÊýµÄ·½·¨¡£
¹Ø¼ü×Ö£ºC³ÌÐò£¬Íⲿ±äÁ¿£¬º¯Êý
¡¡¡¡C³ÌÐòÓÉÒ»×é¶ÔÏó×é³É£¬ÕâЩ¶ÔÏó°üÀ¨³ÌÐòÖÐËùʹÓõıäÁ¿ºÍʵÏÖÌض¨¹¦Äܵĺ¯Êý¡£±äÁ¿¿ÉÒÔ·ÖΪº¯ÊýÄÚ²¿¶¨Ò塢ʹÓõıäÁ¿ºÍº¯ÊýÍⲿ¶¨ÒåµÄ±äÁ¿£¬Í¨³£Çé¿öÏ£¬°Ñº¯ÊýÄÚ²¿¶¨Ò塢ʹÓõıäÁ¿³ÆÎ ......