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

C/C++Öеĺê


ºê¶¨ÒåÁËÒ»¸ö´ú±íÌض¨ÄÚÈݵıêʶ·û¡£Ô¤´¦Àí¹ý³Ì»á°ÑÔ´´úÂëÖгöÏֵĺê±êʶ·ûÌæ»»³Éºê¶¨ÒåʱµÄÖµ¡£ºê
×î³£¼ûµÄÓ÷¨ÊǶ¨Òå´ú±íij¸öÖµµÄÈ«¾Ö·ûºÅ¡£ºêµÄµÚ¶þÖÖÓ÷¨ÊǶ¨Òå´ø²ÎÊýµÄºê£¬ÕâÑùµÄºê¿ÉÒÔÏóº¯ÊýÒ»Ñù
±»µ÷Ó㬵«ËüÊÇÔÚµ÷ÓÃÓï¾ä´¦Õ¹¿ªºê£¬²¢Óõ÷ÓÃʱµÄʵ¼Ê²ÎÊýÀ´´úÌ涨ÒåÖеÄÐÎʽ²ÎÊý¡£
1.#defineÖ¸Áî
#defineÔ¤´¦ÀíÖ¸ÁîÊÇÓÃÀ´¶¨ÒåºêµÄ¡£¸ÃÖ¸Áî×î¼òµ¥µÄ¸ñʽÊÇ£ºÊ×ÏÈÉñÃ÷Ò»¸ö±êʶ·û£¬È»ºó¸ø³öÕâ¸ö±ê
ʶ·û´ú±íµÄ´úÂë¡£ÔÚºóÃæµÄÔ´´úÂëÖУ¬¾ÍÓÃÕâЩ´úÂëÀ´Ìæ´ú¸Ã±êʶ·û¡£ÕâÖÖºê°Ñ³ÌÐòÖÐÒªÓõ½µÄһЩȫ¾ÖÖµ
ÌáÈ¡³öÀ´£¬¸³¸øһЩ¼ÇÒä±êʶ·û¡£
#define MAX_NUM 10
int array[MAX_NUM];
for(i = 0; i < MAX_NUM; i++) /*……*/
ÔÚÕâ¸öÀý×ÓÖУ¬¶ÔÓÚÔĶÁ¸Ã³ÌÐòµÄÈËÀ´Ëµ£¬·ûºÅMAX_NUM¾ÍÓÐÌض¨µÄº¬Ò壬Ëü´ú±íµÄÖµ¸ø³öÁËÊý
×éËùÄÜÈÝÄɵÄ×î´óÔªËØÊýÄ¿¡£³ÌÐòÖпÉÒÔ¶à´ÎʹÓÃÕâ¸öÖµ¡£×÷ΪһÖÖÔ¼¶¨£¬Ï°¹ßÉÏ×ÜÊÇÈ«²¿Óôóд×ÖĸÀ´¶¨
Òåºê£¬ÕâÑùÒ×ÓڰѳÌÐòºìµÄºê±êʶ·ûºÍÒ»°ã±äÁ¿±êʶ·ûÇø±ð¿ªÀ´¡£Èç¹ûÏëÒª¸Ä±äÊý×éµÄ´óС£¬Ö»ÐèÒª¸ü¸Äºê
¶¨Òå²¢ÖØбàÒë³ÌÐò¼´¿É¡£
ºê±íʾµÄÖµ¿ÉÒÔÊÇÒ»¸ö³£Á¿±í´ïʽ£¬ÆäÖÐÔÊÐí°üÀ¨Ç°ÃæÒѾ­¶¨ÒåµÄºê±êʶ·û¡£ÀýÈ磺
#define ONE 1
#define TWO 2
#define THREE (ONE+TWO)
×¢ÒâÉÏÃæµÄºê¶¨ÒåʹÓÃÁËÀ¨ºÅ¡£¾¡¹ÜËüÃDz¢²»ÊDZØÐëµÄ¡£µ«³öÓÚ½÷É÷¿¼ÂÇ£¬»¹ÊÇÓ¦¸Ã¼ÓÉÏÀ¨ºÅµÄ¡£Àý
È磺
six = THREE * TWO;
Ô¤´¦Àí¹ý³Ì°ÑÉÏÃæµÄÒ»ÐдúÂëת»»³É£º
six = (ONE + TWO) * TWO;
Èç¹ûûÓÐÄǸöÀ¨ºÅ£¬¾Íת»»³Ésix = ONE + TWO * TWO;ÁË¡£
ºê»¹¿ÉÒÔ´ú±íÒ»¸ö×Ö·û´®³£Á¿£¬ÀýÈ磺
#define VERSION "Version 1.0 Copyright(c) 2003"
2.´ø²ÎÊýµÄ#defineÖ¸Áî
´ø²ÎÊýµÄºêºÍº¯Êýµ÷Óÿ´ÆðÀ´ÓÐЩÏàËÆ¡£¿´Ò»¸öÀý×Ó£º
#define Cube(x) (x) * (x) * (x)
¿ÉÒÔʱÈκÎÊý×Ö±í´ïʽÉõÖÁº¯Êýµ÷ÓÃÀ´´úÌæ²ÎÊýx¡£ÕâÀïÔÙ´ÎÌáÐÑ´ó¼Ò×¢ÒâÀ¨ºÅµÄʹÓ᣺êÕ¹¿ªºóÍêÈ«
°üº¬ÔÚÒ»¶ÔÀ¨ºÅÖУ¬¶øÇÒ²ÎÊýÒ²°üº¬ÔÚÀ¨ºÅÖУ¬ÕâÑù¾Í±£Ö¤Á˺êºÍ²ÎÊýµÄÍêÕûÐÔ¡£¿´Ò»¸öÓ÷¨£º
int num = 8 + 2;
volume = Cube(num);
Õ¹¿ªºóΪ(8 + 2) * (8 + 2) * (8 + 2);
Èç¹ûûÓÐÄÇЩÀ¨ºÅ¾Í±äΪ8 + 2 * 8 + 2 * 8 + 2ÁË¡£
ÏÂÃæµÄÓ÷¨ÊDz»°²È«µÄ£º
volume=Cube(num++);
Èç¹ûCubeÊÇÒ»¸öº¯Êý£¬ÉÏÃæµÄд·¨ÊÇ¿ÉÒÔÀí½âµÄ¡£µ«ÊÇ£¬ÒòΪCubeÊÇÒ»¸öºê£¬ËùÒÔ»á²úÉú¸±×÷Óá£
ÕâÀïµÄ²ÁÊé²»ÊǼòµ¥µÄ±í´ïʽ£¬ËüÃǽ«²úÉúÒâÏë²»µ½µÄ½á¹û¡£ËüÃÇÕ¹¿ªºóÊÇÕâÑùµÄ£º
volume = (num++) * (num++) * (


Ïà¹ØÎĵµ£º

C/C++µ¥Ôª²âÊÔÀíÂÛ¾«Òª£¨Î壩

µÚ¶þÕ Õ÷·þ¿É²âÐÔÄÑÌâ
 
2.1 ¿É²âÐÔÎÊÌâÏê½â£¨1£©
 
    µ¥Ôª²âÊÔЧÒæÌرð¸ß£¬·½·¨Ò²ºÜ¼òµ¥£¬µ«È´³¢ÊÔµÄÆóÒµºÜ¶à£¬³É¹¦ÊµÊ©µÄÆóÒµºÜÉÙ£¬ÎªÊ²Ã´ÄØ£¿Ö÷ÒªÔ­Òò¾ÍÊÇÄÑÓÚÍ»ÆƿɲâÐÔÎÊÌâ¡£“¿É²â”Õâ¸ö´Ê£¬Òâ˼ÒѾ­ºÜÃ÷°×ÁË£¬Èç¹û²»“¿É²â”µÄ»°£¬ÄǾÍÊDz»Äܲ⣬û·¨²â£¬¾ÍÊÇ× ......

C³ÌÐò£ºÈ·¶¨Ò»¸öÕûÊýµÄ¼ÆËã»úÄÚ²¿±íʾÖÐÓм¸¸ö"1"

/*
×¢Òâ²»¶ÏÓÒÒÆÅжÏ×îµÍλÊÇ1ÓжàÉÙ¸öµÄËã·¨ÊÇ´íÎóµÄ£¬
ÒòΪ¸ù¾ÝGNU C/C++µÄʵÏÖÀ´¿´£¬¸ºÊýÊÇ´ø·ûºÅÌî³ä½øÐÐÓÒÒƵģ¬ËùÒÔÈç¹ûÊǸºÊý£¬¸ÃËã·¨»áËÀÑ­»·¡£
±äͨ°ì·¨£ºJava¿ÉÒÔÓÃ>>>Âß¼­ÓÒÒÆλ²Ù×÷·û£¬C/C++¿ÉÒÔÇ¿ÖÆת»»³ÉÎÞ·ûºÅÕûÊýÔÙ´¦Àí
ÏÂÃæµÄ³ÌÐòÊÇÕý½â¡£ÆäÖÐnum &= (num - 1) »áÏû³ýnumµÄ×îСλÖõÄ"1" ......

¹æ·¶»¯µÄC++±à³Ì·½·¨±¸Íü¼ C/C++ËãÊýÔËË㣺

    ÒѾ­ÖªµÀµÄ£¬²»ËµÁË...´ó¼Ò¶¼ÖªµÀµÄ£¬¿ÉÒÔÎÊÎÊ£¬²é²é×ÊÁÏ¡£ÕâÀïÓÖ·ÅЩ¸½¼Ó½¨Ò飺
1.»ù±¾ËãÊýÔËË㣺
  ¼ÈÈ»¼ÆËã»úÀïûÓÐÕæÕýµÄÕûÊý£¬ÄÇô¼ÆËã»úÀïҲûÓÐÕæÕýµÄËãÊýÔËËã¡£
    È¡Öµ·¶Î§£º
  ÉèaºÍbÊÇÁ½¸öÕ¼Ò»Ñùλ¿íµÄÎÞ·ûºÅÕûÊý£¬ÕâÖÖÕûÊý¿ÉÈ¡µ½×î´óÖµM ......

javaSocket¿Í»§¶ËÓëC·þÎñ¶ËͨÐÅ

ת×Ô£ºhttp://hi.baidu.com/ssrt_hanbing/blog/item/62e3b934598eeb82a71e1238.html
ͨ¹ý¸ßµÍλת»»¡£
package com.commnt;
import java.net.*;
import java.io.*;
public class Client {
public String send(String address, int port, String str) {
   OutputStream os = null;
   DataInpu ......

S3C2410 Nand Flash¿ØÖÆÆ÷

    ·ÃÎÊNand FlashʱÐèÒªÏÈ·¢³öÃüÁȻºó·¢³öµØÖ·ÐòÁУ¬×îºó¶Á/дÊý¾Ý£»
    ÐèҪʹÓø÷¸öÐźÅÀ´·Ö±æÃüÁî¡¢µØÖ·¡¢Êý¾Ý£»
    S3C2410 µÄNand  Flash¿ØÖÆÆ÷ ÌṩÁËÏà¹Ø¼Ä´æÆ÷À´¼ò»¯ÕâЩ²Ù×÷£º
           & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ