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

¹ØÓÚCµÄÓÐȤÎÊÌâ

//ÒÔϳÌÐòÊÇʵÏÖСдת´óд³ÌÐò
#include<stdio.h>
void to_upper(char *str)
{
    for(;*str !='\0';str++)
    {
        if(unsigned(*str-'a')<='z'-'a')
            *str-='a'-'A';//Сдת³É´óд
    }
}
void main()
{
    char *str="Are you ready?";
    to_upper(str);
    printf("%s\n",str);
}
ÒÔÉϳÌÐòÔÚ±àÒëºÍÁ¬½Ó¶¼Í¨¹ýÁË£¬µ«È´µÃ²»³ö½á¹û£¡£¡
char *str="Are you ready?";¶ÔÓ¦µÄ»ã±à
004010A8   mov         dword ptr [ebp-4],offset string "Are you ready?" (00422020)
¸ÄÕýΪ£º
#include<stdio.h>
void to_upper(char *str)
{
    for(;*str !='\0';str++)
    {
        if(unsigned(*str-'a')<='z'-'a')
            *str-='a'-'A';//Сдת³É´óд
    }
}
void main()
{
    char str[]="Are you ready?";
    to_upper(str);
    printf("%s\n",str);
}
Êä³ö£ºARE YOU READY£¿
char str[]="Are you ready?"¶ÔÓ¦µÄ»ã±à£º
004010A8   mov         eax,[string "Are you ready?" (00422020)]
004010AD   mov         dword ptr [ebp-10h],eax
004010B0   mov         ecx,dword ptr [string "Are you ready?"+4 (00422024)]
004010B6   mov         dword ptr [ebp-0Ch],ecx
004010B9   mov         edx,dword ptr [string "Are you ready?"+8 (00422028)]
004010BF   mov         dword ptr [ebp-8],edx
004010C2 


Ïà¹ØÎĵµ£º

C puzzles


Authentication
Login with:New JS-Kit account
Google Friend Connect
Twitter account
FriendFeed account
Yahoo account
Blogspot URL
JS-Kit account
Haloscan account
OpenID
Dear visitor,
Thanks for your interest in C programming.
In this page, you will find a
list of interesting C p ......

Linux CÓïÑÔдµÄ³¬¼¶¼òµ¥¶Ë¿ÚɨÃèÆ÷

 Õâ¸ö±¾À´ÒÔǰҲд¹ýµÄ£¬½ñÌìÎÞÁĸ´Ï°Ï ÔÙдһ±é¡£¼òµ¥µÄÒ»ËúºýÍ¿£¬Ð´µÄ²»Õ¦µØ´ó¼Ò¼ûÁÂŶ£¡ÓпÕÔÙ¼ÓÇ¿ ºÙºÙ£¡
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h ......

Àí½â¸´ÔÓµÄC/C++ÉùÃ÷ const, typedef , º¯ÊýÖ¸Õë

 ÈÃÎÒÃÇ´ÓÒ»¸ö·Ç³£¼òµ¥µÄÀý×Ó¿ªÊ¼£¬ÈçÏ£º
int n;
Õâ¸öÓ¦¸Ã±»Àí½âΪ“declare n as an int”£¨nÊÇÒ»¸öintÐ͵ıäÁ¿£©¡£
½ÓÏÂÈ¥À´¿´Ò»ÏÂÖ¸Õë±äÁ¿£¬ÈçÏ£º
int *p;
Õâ
¸öÓ¦¸Ã±»Àí½âΪ“declare p as an int *”£¨pÊÇÒ»¸öint
*Ð͵ıäÁ¿£©£¬»òÕß˵pÊÇÒ»¸öÖ¸ÏòÒ»¸öintÐͱäÁ¿µÄÖ¸Õë¡£ÎÒÏëÔÚÕ ......

Linux C ±à³Ì ʵÏÖ²ÊÉ«ÎÄ×ÖÊä³ö

¸ñʽ: echo "\033[×Ö±³¾°ÑÕÉ«;×ÖÌåÑÕÉ«m×Ö·û´®\033[0m"
ÀýÈç:
echo "\033[41;36m something here \033[0m"
ÆäÖÐ41µÄλÖôú±íµ×É«, 36µÄλÖÃÊÇ´ú±í×ÖµÄÑÕÉ«
ÄÇЩascii code ÊǶÔÑÕÉ«µ÷ÓõÄʼĩ.
\033[ ; m …… \033[0m
×Ö±³¾°ÑÕÉ«·¶Î§:40----49
40:ºÚ
41:Éîºì
42:ÂÌ
43:»ÆÉ«
44:À¶É«
45:×ÏÉ«
4 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ