Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C/C++º¯Êý²ÎÊý,´«ÖµÓò´«Ö·µÄÇø±ð!!!

/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
class A{
public:
A(){
cout << "Ö´Ðй¹Ô캯Êý´´½¨Ò»¸ö¶ÔÏó" << endl;
}
A(A&){
cout << "Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó" << endl;
}
~A(){
cout << "Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó" << endl;
}
};
void func(A a){
cout << "µ÷ÓÃÒ»¸ö´«Öµº¯Êý" << endl;
}
void func2(A &a){
cout << "µ÷ÓÃÒ»¸ö´«Ö·º¯Êý" << endl;
}
A getA(A a){
return a;
}
A getA2(A &a){
return a;
}
/**
* ͬgetA4
*/
A* getA3(A &a){
return &a;
}
/**
* ͬgetA3
*/
A* getA4(A *a){
return a;
}
/*
* °´Öµ´«µÝµÄȱµã...µ±´´½¨Ò»¸öеĶÔÏóÖ®ºó,Èç¹û°´Öµ´«µÝ
* ½«¸´Öƹ¹Ô캯Êý´´½¨¶ÔÏóµÄ¸±±¾,¸±±¾ÔÚʹÓÃÍê³ÉÖ®ºó,ÓÖ»áÖ´ÐÐÎö¹¹º¯Êýɾ³ý¸Ã¸±±¾!
*/
int main(int argc, char** argv) {
A a;
func(a);
func(a);
cout << "-------" << endl;
func2(a);
func2(a);
cout << "-------" << endl;
getA(a); // ½«¿½±´2¸ö¶ÔÏóºÍɾ³ý2¸ö¶ÔÏó,1¸ö¶ÔÏóÊÇ×÷Ϊ²ÎÊý´«µÝµÄ,ÁíÍâÒ»¸ö¶ÔÏóÊÇ×÷Ϊֵ·µ»ØµÄ!
cout << "-------" << endl;

getA2(a); // ½«¿½±´1¸ö¶ÔÏóºÍɾ³ý1¸ö¶ÔÏó,¸Ã¶ÔÏóÊÇ×÷Ϊֵ·µ»ØµÄ!
cout << "-------" << endl;
getA3(a); // ½«²»¿½±´aµÄ¶ÔÏó×öΪ²ÎÊý,Ò²²»»á¿½±´aµÄ¶ÔÏó×÷Ϊ·µ»ØÖµ(°üÀ¨É¾³ý)!
getA4(&a);
return (EXIT_SUCCESS);
}
Ö´Ðй¹Ô캯Êý´´½¨Ò»¸ö¶ÔÏó
Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó
µ÷ÓÃÒ»¸ö´«Öµº¯Êý
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó
µ÷ÓÃÒ»¸ö´«Öµº¯Êý
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
-------
µ÷ÓÃÒ»¸ö´«Ö·º¯Êý
µ÷ÓÃÒ»¸ö´«Ö·º¯Êý
-------
Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó
Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
-------
Ö´Ðп½±´º¯Êý¿½±´Ò»¸ö¶ÔÏó
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
-------
Ö´ÐÐÎö¹¹º¯Êýɾ³ýÒ»¸ö¶ÔÏó
ÔËÐгɹ¦£¨×ܼÆʱ¼ä£º 255ºÁÃ룩


Ïà¹ØÎĵµ£º

ÉîÈëC/C++Ö®»ùÓÚCheckStackVarsµÄ°²È«¼ì²é£¨VS2008£©

×î½üһֱæ±ÏÒµµÄÏà¹ØÊÂÇ飬¼ÓÉϹ¤×÷£¬×ªÑۼ䣬ÓÖµ½Ôµ×ÁË£¬Ö®Ç°³ÐŵµÄÿÔÂһƪ²©ÎÄ£¬Ç°¼¸Ìì¾ÍÒ»Ö±ÔÚÑ°ÕÒµ½µ×Ҫдʲô£¬½üÁ½ÌìÓÖͻȻ·¢ÏÖÓкܶණÎ÷¿ÉÒÔд¡£±¾Æª¾ÍÏÈÑÓÐø֮ǰµÄһƪ»ùÓÚCookieµÄ°²È«¼ì²é»úÖÆ£¨ÉîÈëC/C++Ö®»ùÓÚCookieµÄ°²È«¼ì²é£¨VS2005£©£©À´½éÉÜÏÂÁíÍâÒ»ÖÖÔÚDEBUG°æ±¾Ïµİ²È«¼ì²é£¬Ò²¾ÍÊÇCheckStackVars¼ì ......

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС

CºÍC++ÖеÄÖ÷ÒªÊý¾ÝÀàÐͺÍ×Ö½Ú´óС(
    C/C++µÄд·¨ÊDz»¿ÆѧºÍ²»ÑϽ÷µÄ¡£ÒòΪCºÍC++ËäÈ»ÓïÒ壬µ«ÊÇÉè¼Æ˼ÏëÊǽṹ»¯ÓëÃæÏò¶ÔÏó. C±ê×¼¹æ·¶ÓëC++µÄ±ê×¼¹æ·¶Ò²ÊÇÁ½¸öÎı¾¡£½üÀ´×ÐϸÑо¿ÁËËüÃǵÄÊý¾ÝÀàÐÍ£¬²ÅÖªµÀÆäÀ´ÁúÈ¥Âö£¬ÕæÕý×öµ½ÆäʵËùÒÔÈ»¡£
1¡¢CÓïÑÔ¶¨ÒåÁË5ÖÖ»ù±¾Êý¾ÝÀàÐÍ
  char(×Ö·û), int(Õ ......

AndroidÔ­Éú(Native)C¿ª·¢Ö®Èý£ºÊó±êʼþƪ(²¶Êó¼Ç)


ÔÚ×öSDLÖÁAndroidµÄÒÆֲʱ£¬¼üÅÌʼþÊÇÄÜÕý³£²¶»ñµ½£¬¿´ÁËSLDµÄÔ´Â룬·¢ÏÖÓõÄdeviceÊÇ /dev/tty0£¬µ«ÊÇÊó±ê½ÐÊDz»Äܳɹ¦²¶»ñ£¬×ÜÊǵõ½ 0£¬ÔËÐÐÃüÁî²é¿´devicesʱ£¬ÏÔʾÈçÏ£º
 # cat /proc/bus/input/devices
cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="qwerty ......

ÅжÏC?ÐÐ??¾³µÄ³ÌÐò

/*
**ÅжÏC?ÐÐ??¾³µÄ³ÌÐò
*/
/*
**¾²?³õʼ»¯
*/
int static_variable=5;
void
f()
{
 register int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
 register char *c1, *c2, *c3, *c4, *c5, *c6, *c7 , *c8, *c9, *c10;
 extern int a_very_long_name_to_sec_how_long_they_can_be;
 double ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ