c ÓïÑÔÖеĴ«ÖµÓë´«ÒýÓÃ
#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 value of number is %d\n",number);
return 0;
}
int cubeByValue(int n){
return n*n ;
}
#include<stdio.h>
void cubeByReference(int *nPtr);
int main(){
int number = 5 ;
printf("The original value of number is %d\n",number);
cubeByReference( &number );
printf("The new value of number is %d\n",number);
return 0;
}
void cubeByReference(int *nPtr){
*nPtr = *nPtr * *nPtr ;
}
Ïà¹ØÎĵµ£º
Ò»£® ºÎν¿É±ä²ÎÊý
int printf( const char* format, ...);
ÕâÊÇʹÓùýCÓïÑÔµÄÈËËùÔÙÊìϤ²»¹ýµÄprintfº¯ÊýÔÐÍ£¬ËüµÄ²ÎÊýÖоÍÓй̶¨²ÎÊýformatºÍ¿É±ä²ÎÊý£¨Óᱡ¡±±íʾ£©¡£
¶øÎÒÃÇÓÖ¿ÉÒÔÓø÷ÖÖ·½Ê½À´µ÷ÓÃprintf,Èç:
printf("%d",value);
printf("%s",str);
printf("the number is %d ,st ......
1. cÓïÑÔÖеÄÕûÊýÀàÐÍÓÐchar, short, int, longµÈ¼¸ÖÖ, ÏÂÃæÊÇCÓïÑÔ¶ÔÿÖÖÊý¾ÝÀàÐͳ¤¶ÈµÄ¹æ¶¨:
(a). shortºÍlongÀàÐ͵ij¤¶È²»Ïàͬ
(b). intÀàÐÍͨ³£Í¬¾ßÌå»úÆ÷µÄÎïÀí×Ö³¤Ïàͬ
(c). shortͨ³£ÊÇ16bits, intͨ³£ÊÇ16bits or 32bitsÿÖÖ±àÒëÆ÷¿ÉÒÔ¸ù¾ÝÓ²¼þµÄ²»Í¬×ÔÓÉÈ·¶¨, µ«ÊÇshortºÍint±ØÐë×îÉÙÊÇ16bits, ¶ølongÀàÐͱØÐë× ......
ÖÜÎ忪»á×öÍŶӳÉÔ±codereivew£¬ ÓÐͬÊÂÌá³öÁËÒ»¸ö¹ØÓÚgmtime¶àÏß³ÌÊÇ·ñ°²È«µÄÎÊÌ⣬ µ±Ê±¾õµÃ³ÌÐòLinkÁËVCµÄ¶àÏ߳̿⣬Ӧ¸Ã²»ÊÇÎÊÌâ¡£»¹ºÃ»ØÍ·ºËʵÁËһϣ¬·¢ÏÖÁ˾¹ÊÇÒ»¸öDZÔÚµÄbug¡£
³ÌÐò·ÖÔÚapplication£¨Íê³ÉÏîÄ¿Ìض¨¹¦ÄÜ£©ºÍframework£¨¿ÉÖØÓõĺËÐŦÄÜ£©Á½²¿·Ö£¬Ï̵߳ÄÆô¶¯ÓÉframeworkÍê³É¡£ appÖÐʹÓÃÁËgmtime/loc ......
ÌýÆðÀ´£¬ÓÐ×ÔÐÅ£¬ÓиãЦ¡£ÓÖ×ÔÐÅ£¬ÓÖ¸ãЦ¡£
Á½ÄêÇ°£¬¿¼ÈëÁËÒ»¸ö¶þÁ÷´óѧ£¬·Ç¼ÆËã»úרҵ¡£µ±³õ»³×ÅÎÞ±ÈÃÀºÃµÄÐÄÇ飬ֻÊÇÏ£ÍûÔÚѧУ¹ýµÄ¿ìÀÖЩ£¬Ñ§µÄºÃЩ£¬µ«ÊÇÓÐЩÊÂÇé×ÜÊÇÄÑÒÔÔ¤ÁÏ£¬ÎÒ×ÜÊÇÎÞ·¨ÍüÈ´ÄÇ·Ý»³ÄÔÚÕâ¸öÄ°ÉúµÄ³ÇÊУ¬ÎÒ×ÜÊÇÃÔʧÁË×Ô¼º¡£Ä¬Ä¬µÄ¶ãÔÚ×Ô¼ºµÄÊÀ½çÀïÌòóÂÉË¿Ú£¬ÔÒÔΪµ½Á˸öеĻ·¾³ÄÜÍüµôÒ»ÇеÄÉËÐÄ¹Ê ......
1.ÄÚ´æ·ÖÅ䷽ʽ
¡¡¡¡ÄÚ´æ·ÖÅ䷽ʽÓÐÈýÖÖ£º
¡¡¡¡[1]´Ó¾²Ì¬´æ´¢ÇøÓò·ÖÅä¡£ÄÚ´æÔÚ³ÌÐò±àÒëµÄʱºò¾ÍÒѾ·ÖÅäºÃ£¬Õâ¿éÄÚ´æÔÚ³ÌÐòµÄÕû¸öÔËÐÐÆڼ䶼´æÔÚ¡£ÀýÈçÈ«¾Ö±äÁ¿£¬static±äÁ¿¡£
¡¡¡¡[2]ÔÚÕ»ÉÏ´´½¨¡£ÔÚÖ´Ðк¯Êýʱ£¬º¯ÊýÄÚ¾Ö²¿±äÁ¿µÄ´æ´¢µ¥Ôª¶¼¿ÉÒÔÔÚÕ»ÉÏ´´½¨£¬º¯ÊýÖ´ÐнáÊøʱÕâЩ´æ´¢µ¥Ôª×Ô¶¯±»ÊÍ·Å¡£Õ»ÄÚ´æ·ÖÅäÔËËãÄÚÖÃÓÚ ......