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

C/C++º¯Êý²ÎÊý,´«ÖµÓò´«Ö·!!!

/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
void swap(int x, int y) {
cout << "x and y swap before : " << x << "\t" << y << endl;
int i = x;
x = y;
y = i;
cout << "x and y swap after : " << x << "\t" << y << endl;
}
void swap2(int * x, int * y) {
cout << "x and y swap before : " << *x << "\t" << *y << endl;
int * i = x;
x = y;
y = i;
cout << "x and y swap after : " << *x << "\t" << *y << endl;
}
/**
* ×¢Òâ,´Ë´¦·Ç&xÓë&y²¢·ÇµØÖ·,¶øÊǶÔÏóµÄ±ðÃû!!!
*/
void swap3(int &x, int &y) {
cout << "x and y swap before : " << x << "\t" << y << endl;
int i = x;
x = y;
y = i;
cout << "x and y swap after : " << x << "\t" << y << endl;
}
/**
* °´Ö·´«µÝ,´«µÝµÄ²ÎÊýÊǵØÖ·.
*/
void swap4(int * x, int * y) {
cout << "x and y swap before : " << *x << "\t" << *y << endl;
int i = *x;
*x = *y;
*y = i;
cout << "x and y swap after : " << *x << "\t" << *y << endl;
}
int main(int argc, char** argv) {
int x = 1;
int y = 9;
cout << "main function swap before : " << x << "\t" << y << endl;
swap(x, y);
cout << "main function swap after : " << x << "\t" << y << endl;
// ¿É½«,Ö÷º¯ÊýµÄxÓëy²¢Ã»Óн»»»,±íʾswapº¯Êý½»»»µÄ½ö½öÊÇxÓëyµÄ¸±±¾
cout << "---------" << endl;
int * px = new int(1);
int * py = new int(9);
cout << "main function swap before : " << *px << "\t" << *py << endl;
swap2(px, py);
cout << "main function swap after : " << *px << "\t" << *py << en


Ïà¹ØÎĵµ£º

ÈçºÎʹÓ÷ºÐÍÄ£擬virtual? (C/C++) (template)

ÍøÉÏÒ»µÀ½ðɽµÄÃæÊÔÌ⣺
http://topic.csdn.net/u/20100524/14/0eff992a-2849-4db6-bdaa-d4a200e79b7c.html
Çë·Ö±ðÓÃC++µÄÃæÏò¶ÔÏóºÍ·ºÐÍ»úÖÆ£¬±àдʵÏÖTemplate MethodģʽµÄʾÀý´úÂ룬²¢±È½ÏÁ½ÖÖ·½Ê½¸÷×ÔµÄÓÅȱµã¡£
ÓÃÐ麯ÊýʵÏÖTemplate MethodµÄ·½Ê½¾Í²»¶à˵ÁË¡£Ó÷ºÐ͵ķ½Ê½ÊµÏÖ¶à̬ÔÚATLÀïÃæÓдóÁ¿µÄÓõ½£¡
·ºÐ͵ ......

SD¿¨µÄдÎļþ ÒÔ¼° CÖÐ#·ûºÅ

Ò»  Ê×ÏÈ×ܽáÒ»ÏÂSD¿¨µÄдÎļþ£¬Ðè×¢ÒâµÄÊÂÏîÈçÏ£º
1. FAT16 дµÄʱºò±ØÐëÖÁÉÙдһ¸öÉÈÇø¡£
2. FAT±í²»ÄÜƵ·±µÄ¶Áд£¬·ñÔò»á³ö´í¡£ÉêÇëеÄÒ»¸ö´Øʱ£¬Ö±½ÓÔÚÕâ¸ö´ØÀïÃ棨¼´ÏÂÒ»´ØºÅ£©µÄдΪ0XFFFF¡£
3. FATËƺõ±ØÐëת»¯³Éu16²ÅÄÜд¡£Ã²ËÆÊÇÕâÑù£¬¾ßÌåû×Ðϸ¿´¡£
4. »ñȡеÄË÷Òý´ØµÄʱºò£¬Ö±½Ó´Ó¾ÉµÄË÷Òý´ØµÄºóÃæ ......

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

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

ÅжÏ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 ......

CµÄ18¸ö¾­µäÎÊÌâ¡£

1.ÕâÑùµÄ³õʼ»¯ÓÐʲôÎÊÌ⣿char *p = malloc(10); ±àÒëÆ÷Ìáʾ“·Ç·¨³õʼʽ” ÔÆÔÆ¡£
´ð:Õâ¸öÉùÃ÷ÊǾ²Ì¬»ò·Ç¾Ö
²¿±äÁ¿Â𣿺¯Êýµ÷ÓÃÖ»ÄܳöÏÖÔÚ×Ô¶¯±äÁ¿(¼´¾Ö²¿·Ç¾²Ì¬±äÁ¿) µÄ³õʼʽÖС£
ÒòΪ¾²Ì¬±äÁ¿µÄµØÖ·±ØÐëÔÚ±àÒëµÄ¹ý³ÌÖоÍÈ·¶¨ÏÂÀ´¶ømalloc()Éê
ÇëµÄÄÚ´æµØÖ·ÊÇÔÚÔËÐÐʱȷ¶¨µÄ¡£
2. *p++ ×ÔÔöp »¹ÊÇp ËùÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ