當前位置:編程學習大全網 - 編程軟體 - VC編程案例

VC編程案例

# include & ltstdio.h & gt

# include & ltstdlib.h & gt

# include & ltstring.h & gt

int main()

{

無符號字符*字符串;

無符號字符str 1[3];/*註意這裏*/

int len

str = " abcdefg

len = strlen(str);

strncpy(str1,str+2,2);

str 1[2]= ' \ 0 ';/*這句話是必須的,但是使用strcpy()的時候,*/

printf("%d\n ",len);

printf("%s\n ",str 1);

系統(“暫停”);

返回0;

}

再來壹個:

# include & ltstudio.h & gt

# include & ltstring.h & gt

內部測試字符串(char *s)

{ char * p = s;

while (*p)

p++;

返回p-s;

}

  • 上一篇:蘋果手寫鍵盤怎麽設置
  • 下一篇:怎麽切Kenzo?
  • copyright 2024編程學習大全網