先看我 这里什么问题
#include <stdio.h>
#include <string.h>
#define LEN 1000
#define ROWS 10
void gets_str1(char *p[],int n); //问题在这里,看我这里有错吗?
void main()
{
char str[ROWS][LEN];
int i=0;
printf("输入字符串\n");
gets_str1(str,10); //这里的参数一直说“不兼容”,我了个去啊
}
我是参见CPP 309页写来的啊
贴上函数原型,求解啊
void gets_str1(char *p[],int n) //读取N个字符串;
{
int i;
for(i=0;i<n;i++)
{
gets(*p);
if(*p==NULL) {break;}
p++;
}
}
#include <stdio.h>
#include <string.h>
#define LEN 1000
#define ROWS 10
void gets_str1(char *p[],int n); //问题在这里,看我这里有错吗?
void main()
{
char str[ROWS][LEN];
int i=0;
printf("输入字符串\n");
gets_str1(str,10); //这里的参数一直说“不兼容”,我了个去啊
}
我是参见CPP 309页写来的啊
贴上函数原型,求解啊
void gets_str1(char *p[],int n) //读取N个字符串;
{
int i;
for(i=0;i<n;i++)
{
gets(*p);
if(*p==NULL) {break;}
p++;
}
}