#include<stdio.h>
#include<conio.h>
main()
{
char *s[10];
fgets(s, 10, stdin);
printf("%s",s);
getch();
}
Type: Posts; User: Rishi Kumar
#include<stdio.h>
#include<conio.h>
main()
{
char *s[10];
fgets(s, 10, stdin);
printf("%s",s);
getch();
}
thanx Elysia...
i dont get any error with fgets...
i use dev c++ with gcc compiler...
but i get a warning: "passing arg 1 of `fgets' from incompatible pointer type"... y???
i dont have a fixed book for studying c...
i refer to tutorials and books then n thr...
any really gud somewat complicated book u wud recommend??
Are char pointers an alternative to strings...???
i am a beginner.... i have never used malloc be4... how to use it...
this program works perfectly in turbo c 2.01....
(removing "&" makes no difference)...
#include<stdio.h>
#include<conio.h>
main()
{
int i;
char *s;
scanf("%s",&s);
printf("%s",s);
getch();
}