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

CÖеĿÕ


1.   ʲôÊÇ¿ÕÖ¸Õë³£Á¿£¨null pointer constant£©?
[ 6.3.2.3-3] An integer constant expression with the value 0, or such an expression cast to type void *, is called a null pointer constant.
ÕâÀï¸æËßÎÒÃÇ£º0¡¢0L¡¢'\0'¡¢3 - 3¡¢0 * 17 £¨ËüÃǶ¼ÊÇ“integer constant expression”£©ÒÔ¼° (void*)0 £¨tyc£ºÎÒ¾õµÃ(void*)0Ó¦¸ÃËãÊÇÒ»¸ö¿ÕÖ¸Õë°É£¬¸üÇ¡µ±Ò»µã£©µÈ¶¼ÊÇ¿ÕÖ¸Õë³£Á¿£¨×¢Òâ (char*) 0 ²»½Ð¿ÕÖ¸Õë³£Á¿£¬Ö»ÊÇÒ»¸ö¿ÕÖ¸ÕëÖµ£©¡£ÖÁÓÚϵͳѡȡÄÄÖÖÐÎʽ×÷Ϊ¿ÕÖ¸Õë³£Á¿Ê¹Óã¬ÔòÊÇʵÏÖÏà¹ØµÄ¡£Ò»°ãµÄ C ϵͳѡÔñ (void*)0 »òÕß 0 µÄ¾Ó¶à£¨Ò²Óиö±ðµÄÑ¡Ôñ 0L£©£»ÖÁÓÚ C++ ϵͳ£¬ÓÉÓÚ´æÔÚÑϸñµÄÀàÐÍת»¯µÄÒªÇó£¬void* ²»ÄÜÏó C ÖÐÄÇÑù×ÔÓÉת»»ÎªÆäËüÖ¸ÕëÀàÐÍ£¬ËùÒÔͨ³£Ñ¡ 0 ×÷Ϊ¿ÕÖ¸Õë³£Á¿£¨tyc: C++±ê×¼ÍƼö£©£¬¶ø²»Ñ¡Ôñ (void*)0¡£
2.   ʲôÊÇ¿ÕÖ¸Õ루null pointer£©?
[6.3.2.3-3] If a null pointer constant is converted to a pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal to a pointer to any object or function.
Òò´Ë£¬Èç¹û p ÊÇÒ»¸öÖ¸Õë±äÁ¿£¬Ôò p = 0;¡¢p = 0L;¡¢p = '\0';¡¢p = 3 - 3;¡¢p = 0 * 17; ÖеÄÈκÎÒ»ÖÖ¸³Öµ²Ù×÷Ö®ºó£¨¶ÔÓÚ C À´Ëµ»¹¿ÉÒÔÊÇ p = (void*)0;£©£¬ p ¶¼³ÉΪһ¸ö¿ÕÖ¸Õ룬ÓÉϵͳ±£Ö¤¿ÕÖ¸Õë²»Ö¸ÏòÈκÎʵ¼ÊµÄ¶ÔÏó»òÕߺ¯Êý¡£·´¹ýÀ´Ëµ£¬ÈκζÔÏó»òÕߺ¯ÊýµÄµØÖ·¶¼²»¿ÉÄÜÊÇ¿ÕÖ¸Õë¡££¨tyc: ±ÈÈçÕâÀïµÄ(void*)0¾ÍÊÇÒ»¸ö¿ÕÖ¸Õë¡£°ÑËüÀí½âΪnull pointer»¹ÊÇnull pointer constant»áÓÐ΢ÃëµÄ²»Í¬£¬µ±È»Ò²²»ÊǽôÒªÁË£©
3.   ʲôÊÇ NULL£¿
[6.3.2.3-Footnote] The macro NULL is defined in <stddef.h> (and other headers) as a null pointer constant
¼´ NULL ÊÇÒ»¸ö±ê×¼¹æ¶¨µÄºê¶¨Ò壬ÓÃÀ´±íʾ¿ÕÖ¸Õë³£Á¿¡£Òò´Ë£¬³ýÁËÉÏÃæµÄ¸÷ÖÖ¸³Öµ·½Ê½Ö®Í⣬»¹¿ÉÒÔÓà p = NULL; À´Ê¹ p ³ÉΪһ¸ö¿ÕÖ¸Õë¡££¨tyc£ººÜ¶àϵͳÖеÄʵÏÖ£º#define NULL (void*)0£¬ÓëÕâÀïµÄ“a null pointer constant”²¢²»ÊÇÍêÈ«Ò»Öµģ©
4.   ¿ÕÖ¸Õ루null pointer£©Ö¸ÏòÁËÄÚ´æµÄʲôµØ·½£¨¿ÕÖ¸ÕëµÄÄÚ²¿ÊµÏÖ£©£¿
±ê×¼²¢Ã»ÓжԿÕÖ¸ÕëÖ¸ÏòÄÚ´æÖеÄʲôµØ·½ÕâÒ»¸öÎÊÌâ×÷³ö¹æ¶¨£¬Ò²¾ÍÊÇ˵ÓÃÄĸö¾ßÌåµÄµØÖ·Öµ£¨0x0 µØÖ·»¹ÊÇijһÌض¨µØÖ·£©±íʾ¿ÕÖ¸ÕëÈ¡¾öÓÚϵͳµÄʵÏÖ¡£ÎÒÃdz£¼ûµÄ¿ÕÖ¸ÕëÒ»°ãÖ¸Ïò 0 µØÖ·£¬¼´¿ÕÖ¸ÕëµÄÄÚ²¿ÓÃÈ« 0


Ïà¹ØÎĵµ£º

CÓïÑÔÁ¬½ÓMySQLÊý¾Ý¿â

Ç°¼¸Ì칫˾ÈÃÎÒ×öCÓïÑÔºÍMySQLÊý¾Ý¿âµÄ½»»¥²Ù×÷£¬·ÑÁ˾ÅÅ£¶þ»¢Ö®Á¦Ö®ºó×ÜËã×ö³öÀ´ÁË£¬½ñÌìÌصذÑÔ´´úÂëÌù³öÀ´¹©´ó¼Òѧϰ£»ÈçÓÐÈËÏëÒª´ò°üÏîÄ¿¿ÉÒÔ¼ÓÎÒQQ260990509,×¢Ã÷¼¼Êõ½»Á÷£¬¼´¿É»ñµÃ´ò°üÖ®ºóµÄÏîÄ¿£¡
#if defined(_WIN32) || defined(_WIN64)  //ΪÁËÖ§³Öwindowsƽ̨ÉϵıàÒë
#include <windows.h>
#end ......

Symbian C/S »úÖÆ·ÖÎö| symbian os

http://www.devdiv.net/blog/space-14481-do-blog-id-458.html

ÒÔÏ·ÖÎö»ùÓÚ£º
Developer Platform :S60 3rd Edition, Feature Pack 2 SDK
Operating System :Symbian OS v9.3
Ò»£¬ÎªÊ²Ã´ÒªÊ¹ÓÃClient/Server¼Ü¹¹
ÔÚSymibian OSÖÐËùÓеÄÒì²½·þÎñ¶¼ÊÇServerͨ¹ýC/S¼Ü¹¹À´ÊµÏֵġ£ClientÊÇÀûÓÃServerÌṩµÄÌض¨· ......

CµÄscanf()

ºÃ¾ÃûÉÏÀ´ÁË...Óеã¶Ô²»Æð×Ô¼ºµÄÁ¼ÐÄ...
»°ËµÕâ¶Îʱ¼ä¿ì¸øÕâ¸öº¯Êý¸ãËÀÁË...
ÎÒÕÒÕÒ...ÎÒÕÒÎÒÕÒ...ÎÒ¾ÍÊÇÒª°ÑËü¸ø¸ãÃ÷°×ÁË...
»°ËµÇ°¶Îʱ¼äÄǸöËÀÈËËÄÔòÔËËãÒ²°Ñ×Ô¼º¸ãµÃ°ëËÀÁË...¶î...ÏÖÔÚ»¹ÔÚÍ£¹¤×´Ì¬...ÔÎËÀ....
ÔÙ˵scanf(),ÉÏÍøÊÇ¿ÉÒÔÕÒµ½Ð©¶«Î÷....µ«ÊǶ¼²»ÔõôÃ÷°×...´òËã×Ô¼º¸ãÃ÷°×ÁËÔÙÉÏÀ´Ð´¸öÏêϸµãµÄ°É... ......

Cº¯ÊýÖ¸Õë×ܽá

±¾ÎĽöÏÞÓÚC£¬Ö÷Òª×Ô¼ºÀÏÍü¡£±ðµÄ·Ï»°ÉÙ˵¡£
1.Basic
Ê×ÏÈ¿¼ÂǺ¯ÊýÔÚº¯ÊýÌåÄڵĶ¨Ò壬ÈçÏ£º 
#include <stdio.h>
#include <stdlib.h>
 
int main()
{
 int add(int,int); 
 int def(int, int);
 printf("%d\n", add(1,3));
 printf("%d\n", def(3,1));
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ