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

C±ê×¼Ô¤¶¨Òåºê

ANSI C±ê×¼ÖÐÓм¸¸ö±ê×¼Ô¤¶¨Òåºê£º__FILE__     __DATE__   __TIME___    __LINE__   µÈ
__LINE__£ºÔÚÔ´´úÂëÖвåÈ뵱ǰԴ´úÂëÐкţ»
__FILE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰԴÎļþÃû£»
__DATE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰµÄ±àÒëÈÕÆÚ
__TIME__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰ±àÒëʱ¼ä£»
__STDC__£ºµ±ÒªÇó³ÌÐòÑϸñ×ñÑ­ANSI C±ê׼ʱ¸Ã±êʶ±»¸³ÖµÎª1£»
__cplusplus£ºµ±±àдC++³ÌÐòʱ¸Ã±êʶ·û±»¶¨Òå¡£
Õ⼸¸öºê±È½ÏÓÐÓá«¡«¡«¡«¡«¡«¡«¡«
ÔÚµ÷ÊÔ³ÌÐòʱ»ò±àÒëʱ£¬__LINE__±È½ÏÓÐÓ㬿ÉÒÔÓÃÀ´´òÓ¡Âß¼­´íÎóµÄÐкš«¡«¡«¡«¡«¡«¡«£¬Àý×Ó£º
switch(x)
{
         case 1:
                   ....;
                   break;
         case 2:
                   .....;
                  break;
          default:
            printf("logic erro line number%d!\n",__LINE__);
            break;
}
ÓÖÈçÀûÓÃ__DATE__ºÍ__TIME__¿ÉÒÔ²åÈë±àÒëʱ¼ä¡£
´úÂ룺
void print_version_info(void)
{
         printf("Date Compiled:%s\n",__DATE__);
         printf("TimeCompiled:%s\n",__TIME__);
}
Êä³ö¸ñʽΪ:mm dd yy ºÍ hh£ºmm£ºss
×÷Ó㺶ÔÓÚ__FILE__£¬__LINE__£¬__func__ÕâÑùµÄºê£¬ÔÚµ÷ÊÔ³ÌÐòʱÊǺÜÓÐÓõģ¬ÒòΪÄã¿ÉÒÔºÜÈÝÒ×µÄÖªµÀ³ÌÐòÔËÐе½ÁËÄĸöÎļþµÄÄÇÒ»
ÐУ¬ÊÇÄĸöº¯Êý¡£
      
ÏÂÃæÒ»¸öÀý×ÓÊÇ´òÓ¡ÉÏÃæÕâЩԤ¶¨ÒåµÄºêµÄ¡£
__DATE__,__FILE__,__LINE__,__TIME__,__FUNCTION__
C±ê×¼ÖÐ


Ïà¹ØÎĵµ£º

Linux Ï CÓïÑÔ´óÎļþ¶Áд(´óÓÚ4G£©

ÒÔϵÄ×ö·¨ÕûÀí×ÔÂÛ̳ÉϵÄÌû×Ó¡£ 
ÈçºÎcreate´óÎļþ
Òª´ó¾Í·Ç³£´ó£¬1T°É¡£
ÓÐÁ½ÖÖ·½·¨£º
 
Ò».dd
dd if=/dev/zero of=1T.img bs=1G seek=1024 count=0
bs=1G±íʾÿһ´Î¶Áд1GÊý¾Ý£¬count=0±íʾ¶Áд0´Î£¬seek=1024±íʾÂÔ¹ý1024¸öBlock²»Ð´£¬Ç°Ãæblock sizeÊÇ1G£¬ËùÒÔ¹²ÂÔ¹ý1T£¡
ÕâÊÇ´´½¨´óÐÍsparseÎļþ×î¼ ......

C/C++ÖеÄÈÕÆÚºÍʱ¼ä

ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼Æʱ¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ÈÕÀúʱ¼ä£©£¬epoch£¨Ê±¼ä ......

python udp c/s ¼Ç¼

server:
import sys
import socket
host = sys.argv[1]
port = int(sys.argv[2])
 
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
 
s.bind((host,port))
 
while 1:
    try:
   &n ......

Îĵµ´¦ÀíµÄcº¯Êý

Îļþº¯Êý´ò¿ªÎļþº¯Êý
[º¯ÊýÍ·]
FILE *fopen£¨char *filename, Char *mode£© 
[²ÎÊý]
filename ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÒª´ò¿ªµÄ´ÅÅÌÎļþÃû£»mode ×Ö·ûÐÍÖ¸Õ룬ָÏòµÄ×Ö·û´®ÊÇÎļþʹÓ÷½Ê½¡£ÕâÁ½¸ö²ÎÊý¶ÔÓ¦µÄʵ²Î¿ÉÒÔÊÇ×Ö·ûÖг£Á¿£¬Ò²¿ÉÒÔÊDz¹·ûÊý×éÊ×µØÖ·£¬»òÕßÊÇÖ¸Ïò×Ö·û´®µÄÖ¸Õë±äÁ¿¡£ 
ÎļþʹÓ÷½Ê½¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ