Use fgets
. This answer is for C.
Change
scanf("%s",a+1);
to
fgets (a, sizeof (a), stdin);
2
solved Not able to check an empty string
Use fgets
. This answer is for C.
Change
scanf("%s",a+1);
to
fgets (a, sizeof (a), stdin);
2
solved Not able to check an empty string