Originally Posted by
Salem
> scanf("%c",&array[i]);
If you want to read the next printable character (ignoring all white space), then add a leading space to your scanf format string.
scanf(" %c",&array[i]);
Thanks salem I have another question where i am struggling
I want to store multiple strings entered by user
Code:
#include<stdio.h>
int main(void)
{
unsigned int i;
char name[5][5]= {"bil","del","sen", "jan","gan"};
for(i=0; i <5;i++)
{
printf("candidate name = %s \n",name[i]);
}
return 0;
}
candidate name = bil
candidate name = del
candidate name = sen
candidate name = jan
candidate name = gan
How to store multiple strings entered by user?