标签:color == set char include tput void amp 通过
1 #include <stdio.h> 2 #include <string.h> 3 4 void reqorder(char *input,char *output,int counter) 5 { 6 int i=0, j=0; 7 char *p=input; 8 char *buf=NULL; 9 10 while((char)(*p)!=‘\0‘) 11 { 12 if((char)(*p)==‘?‘) 13 { 14 if(i==counter) 15 { 16 buf=p+1; 17 while((char)(*buf)!=‘\0‘ && (char)(*buf)!=‘?‘) 18 { 19 j++; 20 buf++; 21 } 22 strncpy(output,p+1,j); 23 return; 24 } 25 i++; 26 } 27 p++; 28 } 29 } 30 31 int main() 32 { 33 char ch[32]="a?b?c?12?34?56?"; 34 char a[8]; 35 memset(a,0,8); 36 reqorder(ch,a,1); 37 printf("%s\n", a); 38 return 0; 39 }
标签:color == set char include tput void amp 通过
原文地址:http://www.cnblogs.com/quliuliu2013/p/6879817.html