Skip to content

Commit 8da67b2

Browse files
committed
new file: composition.c
1 parent 7ecb12a commit 8da67b2

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

composition.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <stdio.h>
2+
#include <stdlib.h>
3+
#include <string.h>
4+
void write();
5+
int main(int argc,char *argv[]){
6+
//char str1[20]="114514";
7+
////char *str2 ="1919810";
8+
//char str3[]= *str2;
9+
//printf("%s\n%s\n",&str1,str2);
10+
////strcpy(str1,str3);
11+
////printf("strcpy(str1,str3):%s\n",str3)
12+
// {'b','a','k','a','\0'};
13+
if ( argc == 1 )
14+
{
15+
printf("please input name\n");
16+
// baka will be used as default");
17+
//char name[] = "baka";
18+
return 0;
19+
}
20+
/* else
21+
{
22+
char *name = argv[1];
23+
}
24+
*/
25+
char composition[99];
26+
//write(composition,name);
27+
write(composition,argv[1]);
28+
printf(composition);
29+
return 0;
30+
}
31+
32+
void write(char saying1[],char name[]){
33+
sprintf(saying1,"%s,my %s,I do love u so much. ",name,name);
34+
char saying2[]="Pls take me away";
35+
strcat(saying1,saying2);
36+
}

0 commit comments

Comments
 (0)