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

×Ö·û´®×ªÊý×Ö£¬Êý×Öת×Ö·û´®Cº¯Êý

atof(½«×Ö·û´®×ª»»³É¸¡µãÐÍÊý)
atoi(½«×Ö·û´®×ª»»³ÉÕûÐÍÊý)
atol(½«×Ö·û´®×ª»»³É³¤ÕûÐÍÊý)
strtod(½«×Ö·û´®×ª»»³É¸¡µãÊý)
strtol(½«×Ö·û´®×ª»»³É³¤ÕûÐÍÊý)
strtoul(½«×Ö·û´®×ª»»³ÉÎÞ·ûºÅ³¤ÕûÐÍÊý)
toascii(½«ÕûÐÍÊýת»»³ÉºÏ·¨µÄASCII Âë×Ö·û)
toupper(½«Ð¡Ð´×Öĸת»»³É´óд×Öĸ)
tolower(½«´óд×Öĸת»»³ÉСд×Öĸ)
     atof(½«×Ö·û´®×ª»»³É¸¡µãÐÍÊý)
Ïà¹Øº¯Êý atoi,atol,strtod,strtol,strtoul
±íÍ·Îļþ #include <stdlib.h>
¶¨Ò庯Êý double atof(const char *nptr);
º¯Êý˵Ã÷ atof()»áɨÃè²ÎÊýnptr×Ö·û´®,Ìø¹ýÇ°ÃæµÄ¿Õ¸ñ×Ö·û,Ö±µ½ÓöÉÏÊý
     ×Ö»òÕý¸º·ûºÅ²Å¿ªÊ¼×öת»»,¶øÔÙÓöµ½·ÇÊý×Ö»ò×Ö·û´®½áÊøʱ
     ('\0')²Å½áÊøת»»,²¢½«½á¹û·µ»Ø¡£²ÎÊýnptr×Ö·û´®¿É°üº¬Õý¸º
     ºÅ¡¢Ð¡Êýµã»òE(e)À´±íʾָÊý²¿·Ö,Èç123.456»ò123e-2¡£
·µ»ØÖµ ·µ»Øת»»ºóµÄ¸¡µãÐÍÊý¡£
¸½¼Ó˵Ã÷ atof()ÓëʹÓÃstrtod(nptr,(char**)NULL)½á¹ûÏàͬ¡£
·¶Àý /* ½«×Ö·û´®a Óë×Ö·û´®bת»»³ÉÊý×ÖºóÏà¼Ó*/
     #include<stdlib.h>
     main()
     {
     char *a=”-100.23”;
     char *b=”200e-2”;
     float c;
     c=atof(a)+atof(b);
     printf(“c=%.2f\n”,c);
     }
Ö´ÐÐ c=-98.23
     atoi(½«×Ö·û´®×ª»»³ÉÕûÐÍÊý)
Ïà¹Øº¯Êý atof,atol,atrtod,strtol,strtoul
±íÍ·Îļþ #include<stdlib.h>
¶¨Ò庯Êý int atoi(const char *nptr);
º¯Êý˵Ã÷ atoi()»áɨÃè²ÎÊýnptr×Ö·û´®,Ìø¹ýÇ°ÃæµÄ¿Õ¸ñ×Ö·û,Ö±µ½ÓöÉÏÊý
     ×Ö»òÕý¸º·ûºÅ²Å¿ªÊ¼×öת»»,¶øÔÙÓöµ½·ÇÊý×Ö»ò×Ö·û´®½áÊøʱ
     ('\0')²Å½áÊøת»»,²¢½«½á¹û·µ»Ø¡£
·µ»ØÖµ ·µ»Øת»»ºóµÄÕûÐÍÊý¡£
¸½¼Ó˵Ã÷ atoi()ÓëʹÓÃstrtol(nptr,(char**)NULL,10);½á¹ûÏàͬ¡£
·¶Àý /* ½«×Ö·û´®a Óë×Ö·û´®bת»»³ÉÊý×ÖºóÏà¼Ó*/
     #include<stdlib.h>
     mian()
     {
  &


Ïà¹ØÎĵµ£º

C/C++Í·ÎļþÒ»ÀÀ

C¼°´«Í³C++
#include <assert.h>¡¡¡¡¡¡¡¡//É趨²åÈëµã
#include <ctype.h>¡¡¡¡¡¡¡¡ //×Ö·û´¦Àí
#include <errno.h>¡¡¡¡¡¡¡¡ //¶¨Òå´íÎóÂë
#include <float.h>¡¡¡¡¡¡¡¡ //¸¡µãÊý´¦Àí
#include <fstream.h>¡¡¡¡¡¡ //ÎļþÊäÈ룯Êä³ö
#include <iomanip.h>¡¡¡¡¡¡ //²ÎÊý»¯ÊäÈ룯Êä³ö ......

¡¾×ª¡¿¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ »ù±¾Êý¾ÝÀàÐÍ

ǰһƪÎÒÃǽéÉÜÁËÒ»¸ö¼òµ¥²»¹ýµÄhelloworld³ÌÐòÒý³öÏà¹ØÎÊÌâ¡£³Ã×Å»¹Ã»ÓÐÍüµôÄÇЩ˼¿¼·½Ê½µÄ¼ÇÒ䣬±¾Æª¼ÌÐøÑÓÐøÕâÖÖ˼ά·½Ê½µÄÀíÄ½éÉÜÒ»ÏÂCC++ÖеĻù±¾Êý¾ÝÀàÐÍ¡£Êý¾ÝÀàÐͲ»Çå³þµÄ»°ÔÚÒÔºóµÄ±à³ÌÖлáÓкܶàÃÕÍźÍÎÊÌâ¡£ÉõÖÁÒ»¸ö³ÌÐòµÄBUGÕÒ°ëÌìҲûÓÐÕÒ³öÀ´Ê±ÎªÊ²Ã´£¬½á¹û²Å·¢ÏÖÊǼӼõÒç³öÁË¡£¸ü¼ÓÑÏÖصĻ¹ÓÐдԽ½ç¡¢¶ÁÔ ......

±ïÁËÒ»Ì죬×îÖÕд³öÀ´Á˵ÄÇó×î´ó¹«Ô¼ÊýµÄ³ÌÐò£¨C£©

Ç°ÌìÍíÉÏÓöµ½Ò»Ì⣬±àд³ÌÐòÇó³ö×î´ó¹«ÒòÊý£¨×î´ó¹«Ô¼Êý£©£¬±¾ÄܵÄÎÒÏëÆðÀ´ÁËÊýѧÖÐÇó×î´ó¹«ÒòʽµÄ·½·¨£¬¿ÉÊÇÔÚ³ÌÐòʵ¼ùÉÏ
Ã÷ÏԵijöÁËÎÊÌ⣬Á½¸öÊýÒªÒ»¸öÒ»¸öµÄ½øÐвð½â£¬È»ºóÕÒµ½ÏàͬµÄ£¬Õâ¸ù±¾ÊÇÒ»ÌõËÀ·£¬Ë¼Ë÷Ò»Ò¹ÐÑÀ´£¬Í»È»±Å·¢Áé¸Ð£¬¿ÉÒÔ
ÓÃÁ½¸öÊý½øÐÐÈ¡ÓàÔËË㣬Èç¹ûÓàÊýΪÁãÔò×î´ó¹«ÒòÊýΪ±»³ýÊý£¬²»ÎªÁãÔòÓàÊýΪ×î ......

cÖÐÄÚ´æ·ÖÅä&±äÁ¿µÄ´æ´¢Àà±ð

Ò»ÔÚcÖзÖΪÕ⼸¸ö´æ´¢Çø
1.Õ» - ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å
2.¶Ñ - Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ
3.È«¾ÖÇø£¨¾²Ì¬Çø£©£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿µÄ´æ´¢ÊÇ·ÅÔÚÒ»¿éµÄ£¬³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿ÔÚÒ»¿éÇøÓò£¬Î´³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍδ³õʼ»¯µÄ¾²Ì¬±äÁ¿ÔÚÏàÁÚµÄÁíÒ»¿éÇøÓò¡£- ³ÌÐò½áÊøÊÍ·Å
4.´æ´¢³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ