当我编译这个程序时,我只得到第一个大写字母而不是其余的.
ABldjfdslkjfCK
我只得到'A'就是这样吗?
#include <stdio.h>
#include <string.h>
FILE *fp;
int main(void)
{
int size;
char input[100]; // array size of 100
if (fp = fopen("message.txt","r")) // file exists
{
fgets(input,100,fp);// scans the sentence.
}
else
{
printf("file not found");// if there is no such a file.
}
size=strlen(input);
recursive(size,input);
return 0;
}
int recursive(int size, char array[])
{
static int index = 0; // static so when the function is called, the value is kept
if (index < size) …Run Code Online (Sandbox Code Playgroud)