this is my code:
Code:
#include<stdio.h>
#include<string.h>
#define size 100
int main()
{
char strsrc[size];
char strtmp[size];
printf("\n Enter String:= ");
fgets(strsrc);
strcpy(strtmp,strsrc);
strrev(strtmp);
if(strcmp(strsrc,strtmp)==0)
printf("\n Entered string \"%s\" ispalindrome",strsrc);
else
printf("\n Entered string \"%s\" is not palindrome",strsrc);
}
when i try to compile it ... its gives me this error
1.no new line at the end of file
2.in function main : too few arguments to function 'fgets'
would you please explain why this is happening and what the solution might be...
by the way... this code should be able to read strings with whitespaces and punctuation marks in it ?