1. //func1.c
2. void my_print(char *string)
3. {
4. printf("The string is %s\n",string);
5. }
1. //func2.c
2. void my_print2(char *string)
3. {
4. char *string2;
5. int size,i;
6. size=strlen(string);
7. string2=(char *)malloc(size+1);
8. for (i=0;i9. string2[size-i]=string[i];
10. string2[size+1]='\0';
11. printf("The string printed backwand is %s\n",string2);
12. }
1. //greet.c
2. #include
3. extern void my_print(char *string);
4. extern void my_print2(char *string);
5. int main()
6. {
7. char my_string[]="hello there";
8. my_print(my_string);
9. my_print2(my_string);
10. }
阅读(782) | 评论(0) | 转发(0) |