cº¯Êý: strtok ºÍ strtok_r
º¯ÊýÃû: strtok
¹¦ ÄÜ: ²éÕÒÓÉÔÚµÚ¶þ¸ö´®ÖÐÖ¸¶¨µÄ·Ö½ç·û·Ö¸ô¿ªµÄµ¥´Ê
ÓÃ ·¨: char *strtok(char *str1, char *str2);
³ÌÐòÀý:
#include <string.h>
#include <stdio.h>
int main(void)
{
char input[16] = "abc,d";
char *p;
/* strtok places a NULL terminator
in front of the token, if found */
p = strtok(input, ",");
if (p) printf("%s\n", p);
/* A second call to strtok using a NULL
as the first parameter returns a pointer
to the character following the token */
p = strtok(NULL, ",");
if (p) printf("%s\n", p);
return 0;
}
´øÓÐ_rµÄº¯ÊýÖ÷ÒªÀ´×ÔÓÚUNIXÏÂÃæ¡£ËùÓеĴøÓÐ_rºÍ²»´ø_rµÄº¯ÊýµÄÇø±ðµÄÊÇ:´ø_rµÄº¯ÊýÊÇḬ̈߳²È«µÄ£¬rµÄÒâ˼ÊÇreentrant,¿ÉÖØÈëµÄ¡£
ÉÏÊö³ÌÐòÔËÐеĽá¹ûÊÇ
abc
d
1. strtok½éÉÜ
ÖÚËùÖÜÖª£¬strtok¿ÉÒÔ¸ù¾ÝÓû§ËùÌṩµÄ·Ö¸î·
Ïà¹ØÎĵµ£º
¸øÎÒÃÇÉÏASP.NETµÄÀÏʦÔÚ½²½âC#µÄʱºò£¬×ÜÊÇҪѯÎÊÎÒÃÇC#ºÍC/C++¼äµÄ²»Í¬Ö®´¦£¬»òÕßһЩϸ½ÚÎÊÌ⣬µ«ÊÇƽʱ²»ÔõôעÒ⣬»¹Õæ°ÑÎÒÃǸøÎʵ½ÁË£¡£¡
Ò».²»¾¹ýÖмä±äÁ¿ÔõÑù½»»»Á½¸öÊý¾Ý int a=25;b=10;
½â·¨: a=a+b;//35
b=a-b;//25
  ......
תÔØ×Ô: http://bbs.chinaitlab.com/thread-304041-1-1.html
ѧϰCÓïÑÔ²»ÊÇÒ»³¯Ò»Ï¦µÄÊÂÇ飬µ«Ò²²»ÐèÒª»¨·ÑÊ®Äêʱ¼ä²ÅÄܾ«Í¨¡£ÈçºÎÒÔ×îСµÄ´ú¼Ûѧϰ²¢¾«Í¨CÓïÑÔÊDZ¾ÎĵÄÖ÷Ìâ¡£Çë×¢Ò⣬¼´Ê¹ÊÇ“×îСµÄ´ú¼Û”£¬Ò²¾ø²»ÊÇʲô½Ý¾¶£¬¶øÊÇÒÔ×î¶ÌµÄʱ¼äÈ¡µÃ×î¶àµÄÊÕ»ñ£¬Í¬Ê±Ò²Òâζ×ÅÄãÐèÒª¾Àú¼è¿àµÄ¹ý³Ì¡£
Ò»¡¢Òª¶Á ......
3: int main()
4: {
5: int i = 1,j;
6: union test{
7: int m;
8: ......
ͨ¹ýÇ°ÃæÁ½Æª£¬ÏàÐÅ´ó¼ÒÒѾ»ù±¾Á˽âÁËÎÒÃǵÄÑо¿Ë¼Â·¡£¼ÈÈ»ÊÇÑо¿£¬ÄÇô±ØÐëµÄÑо¿¹¤¾ß¾ÍµÃÊìÁ·ÕÆÎÕÁË¡£ÕâÀïÎÒËùÖ¸µÄÑо¿¹¤¾ß¾ÍÊÇVC£¬ÎÒËùʹÓõÄVC°æ±¾ÊÇ2005¡£±¾ÎÄÒ²½«¸ù¾ÝVC2005½øÐÐ̽ÌÖ¡£¿ÉÄܺܶàÅóÓÑ»òÕß³õѧÕß»¹ÊÇʹÓõÄVC6.0¡£ÔÚÕâÀï±¾È˲»ÍƼöʹÓÃVC6.0¡£ÔÒòºÜ¼òµ¥£¬VC6.0ÒѾ¹ýʱÁË£¬ºóÃæµÄ°æ±¾±ÈVC6.0¸üÇ¿´ó·½±ã ......
"endian"Õâ¸ö´Ê³ö×Ô<<¸ñÁзðÓμÇ>>,СÈ˹úµÄÄÚÕ½¾ÍÔ´ÓÚ³Ô¼¦µ°Ê±ÊǾ¿¾¹´Ó´óÍ·(Big-Endian)Çÿª»¹ÊÇ´ÓСͷ(Little-Endian)Çÿª.ÎÒÃÇÒ»°ã½«endian·Òë³É"×Ö½ÚÐò",½«big endianºÍlittle endian³Æ×÷"´ó¶Ë"ºÍ"С¶Ë".
ÔÚ¼ÆËã»ú¿ÆѧÁìÓòÖÐ,×Ö½ÚÐòÊÇÖ¸´æ·Å¶à×Ö½ÚÊý¾ÝµÄ×Ö½ÚµÄ˳Ðò,µäÐ͵ÄÇé¿öÊÇÕûÊýÔÚÄÚ´æÖеĴæ·Å·½Ê½ºÍ ......