填空题
请补充函数proc(char*str),该函数的功能是把字符串中的内容逆置。
例如,字符串中原有的字符串为abcdefg,则调用该函数后,串中的内容变为gfedcba。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#define M 81
void proc(char*str)
{
int i=0,t,n=strlen(str);
for(;
1;i++)
{
t=*(str+i);
2;
3;
}
}
void main()
{
char str[M];
system("CLS");
printf("Enter a string:");
gets(str);
printf("The original string is:");
puts(str);
proc(str);
printf("/n");
printf("The string after modified:");
puts(str);