C with classes
This commit is contained in:
28
C/BasicSyntax/Pointer/pointer_test_str1.cpp
Normal file
28
C/BasicSyntax/Pointer/pointer_test_str1.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
//strcmp //<2F><>ϼ<EFBFBD><CFBC>
|
||||
int main(){
|
||||
char str1[100],str2[100];
|
||||
char a[201];
|
||||
//char *sum;
|
||||
scanf("%s %s",str1,str2);
|
||||
int i=0;
|
||||
char *p1,*p2;
|
||||
p1=str1;
|
||||
p2=str2;
|
||||
while(*p1!='\0'){
|
||||
a[i]=*p1;
|
||||
i++;
|
||||
p1++;
|
||||
}
|
||||
a[i]='+';
|
||||
i++;
|
||||
while(*p2!='\0'){
|
||||
a[i]=*p2;
|
||||
i++;
|
||||
p2++;
|
||||
}
|
||||
a[i]='\0';
|
||||
*(a+1)='s';
|
||||
printf("%s",a);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user