¹ØÓÚC/C++º¯ÊýÉùÃ÷ÖвÎÊý¸öÊýµÄÒÉÎÊ
ÎÄÕÂ×÷ÕߣºSlyar
ÏÈ¿´Á½¸ö´úÂ룬µÚÒ»¸öÊÇC³ÌÐò£¬µÚ¶þ¸öÊÇC++³ÌÐò£¬³ýÁËÍ·Îļþ²»Í¬ÒÔÍâÆäËûµÄ¶¼Ò»Ñù¡£
//demo.c
#include <stdio.h>
int foo();
int main()
{
int a;
foo(a);
return 0;
}
int foo(int a)
{
}//demo.cpp
#include <iostream>
int foo();
int main()
{
int a;
foo(a);
return 0;
}
int foo(int a)
{
}
½á¹ûÊÇC³ÌÐò±àÒë³É¹¦£¬C++³ÌÐò±àÒëʧ°Ü£¬Ìáʾº¯ÊýÉùÃ÷ºÍº¯Êý¶¨Òå²ÎÊýÁÐ±í²»·û...ÕâºÜÕý³££¬¹Ø¼üÊÇC³ÌÐòÔõô¿ÉÄܱàÒëͨ¹ý...ÎÒÖªµÀC¿ÉÒÔд¿É±ä²ÎÊýÁÐ±í£¬ÎÊÌâÊÇÎÒû¼ÓÄǸö"..."°¡£¬囧£¬¿´À´ÊDZàÒëÆ÷µÄÎÊÌâÁË£¬ÒòΪ´úÂëÒ»Ñù...
²éÁËһЩ¹úÍâµÄ×ÊÁÏ£¬´óÖÂÁ˽âÁËÉÏÃæÄǸöÎÊÌâµÄ³ÉÒò£¬Í¬Ê±Ò²ÖªµÀÁËf()ºÍf(void)µÄÇø±ð£¬Ö®Ç°Ò»Ö±ÒÔΪËûÃÇÊÇÒ»ÑùµÄ...
In C, the declaration int f(void) means a function returning int that takes no parameters.
ÔÚCÓïÑÔÖУ¬f(void)±íÃ÷º¯Êý·µ»ØÕûÐͲ¢ÇÒûÓÐÈκβÎÊý¡£
The declaration int f() means a function returning int that takes any number of parameters.(takes an unknown number of parameters of unknown types, giving it the wrong number results in undefined behavior. )
¶øf()±íÃ÷º¯Êý·µ»ØÕûÐͲ¢ÇÒ¿ÉÒÔʹÓÃÈÎÒâ¸öÊýµÄ²ÎÊý£¬µ«ÊÇËûµÄÐÐΪÊDz»È·¶¨µÄ¡£
ÓÉ´Ë¿ÉÒÔ¿´³ö£¬ÔÚCÓïÑÔÖÐÊÇÍƼöʹÓÃf(void)ÕâÖÖÐÎʽµÄ£¬ÒòΪËüÃ÷È·Ö¸Ã÷Á˺¯ÊýûÓвÎÊý£¬f()ÓÉÓÚ¿ÉÒÔʹÓÃÈÎÒâ¸öÊýµÄ²ÎÊý£¬µ±È»Ò²°üÀ¨Ã»ÓвÎÊý¡£
¶øÔÚC++ÖУ¬ÎÒÏëÊDz»ÍƼöʹÓÃf(void)ÕâÖÖÐÎʽµÄ£¬ÒòΪf()ÒѾÃ÷È·±íÃ÷ûÓÐÈκβÎÊýÁË¡£
Ïà¹ØÎĵµ£º
ÒÔTMS320VC5402ΪÀý£¬Ì½ÌÖÒ»ÖÖ×ÛºÏÔËÓÃCÓïÑÔ¡¢Êý¾ÝÎļþ¼°GELÓïÑÔµÄFlash±à³Ìз½·¨¡£
¡¡¡¡¸Ã·½·¨ÍêÈ«²ÉÓÃCÓïÑÔ±àдÉÕд³ÌÐò£¬½â¾öÁËÖ¸Õë²»ÄÜ·ÃÎʸ߶ËFlashµÄÎÊÌâ;°ÑÒýµ¼±í×÷³ÉÊý¾ÝÎļþ£¬¿ÉʵÏÖ´óÒýµ¼±íµÄ·ÖÅú´Î¼ÓÔØ;ͨ¹ýGEL³ÌÐò¿ØÖÆC³ÌÐòÖ´ÐУ¬½ÏºÃµØÌåÏÖÁËFlash±à³ÌµÄÁ÷³Ì¡£
¡¡¡¡ÒýÑÔ
¡¡¡¡ÔÚDSPÓ¦ÓÃϵͳ¿ª·¢µÄºóÆÚ£¬Ò»° ......
ʵÑéÒªÇó£º
1.±àд»ùÓÚTCPÐÒéµÄͨÐųÌÐò£¬°üÀ¨ServerÓëClientÁ½¸ö²¿·Ö¡£ÊµÏÖ»ØÉù³ÌÐò£º¼´¿Í»§¶Ë·¢ËÍÏûÏ¢£¬·þÎñÆ÷¶Ë½«ÊÕµ½µÄÏûÏ¢ÔÑù»áË͸ø¿Í»§¶Ë¡£
2.ÔÚµ¥»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»
3.ÔÚ¶à»úÉÏÔËÐÐËüÃÇ£¬ÑéÖ¤ÆäͨÐŽá¹û£»£¨ChatServerÖ»ÐèÔËÐÐÔÚһ̨Ö÷»úÉÏ£¬ChatClient¿ÉÔÚÆäËüÖ÷»úÉÏÔËÐУ¨ÒªÖªµÀChatServerËùÔ ......
#include<stdio.h>
int cubeByValue(int n);
int main(){
int number = 5 ;
printf("The original value of number is %d\n",number);
number = cubeByValue(number);
printf("The new  ......
×î½üÔÚ¿´Linux 2.6.21Äں˵ÄI2CÇý¶¯£¬Ò²ÔÚÍøÉϲéÁËÒ»ÏÂ×ÊÁÏ£¬ÓдíÒ²Óжԣ¬ÓÐЩÐĵ㬼ǼÏÂÀ´°É¡£ÀïÃæÈÏʶ»òÐí¶àÓв»µ±Ö®´¦£¬»¹¿ÒÇëÖ¸Õý¡£
1. I2C ÐÒé
1.1 I2C×ÜÏß¹¤×÷ÔÀí
I2C×ÜÏßÊÇÓÉÊý¾ÝÏßSDAºÍʱÖÓSCL¹¹³ÉµÄ´®ÐÐ×ÜÏߣ¬¸÷ÖÖ±»¿ØÖÆÆ÷¼þ¾ù²¢ÁªÔÚÕâÌõ×ÜÏ ......
1 ÒýÑÔ
¡¡¡¡Linux²Ù×÷ϵͳÒò¾ßÓÐÔ´´úÂ빫¿ª¡¢±ãÓڲüõ¡¢Óй㷺µÄ´¦ÀíÆ÷Ö§³ÖµÈÓŵ㣬³ÉΪµ±Ç°Ç¶ÈëʽϵͳµÄÈÈÃÅÑ¡Ôñ¡£»ùÓÚI2C×ÜÏߵļüÅÌÀ©Õ¹É豸Ö÷ÒªÓÃÓÚÂú×ãǶÈëʽÉ豸ÖжԶఴ¼üµÄÐèÇó£¬Çý¶¯³ÌÐòÔÚϵͳÆô¶¯Ê±¶ÔÓ²¼þ½øÐгõʼ»¯¡£ÔÚϵͳÆô¶¯ºóʵÏÖÓ²¼þºÍÓ¦ÓóÌÐòÖ®¼äµÄÊý¾Ý½»»¥¡£Õë¶ÔS3C2410΢´¦ÀíÆ÷ºÍ¼üÅÌɨÃè¹ÜÀíÆ÷¼þ£¬ÉîÈ ......