How can I read the input as string (with spaces) and deal with it as array of chars?
created
last reply
- 3
replies
- 882
views
- 3
users
- 1
like
- 1
link
How can I read the input as string (with spaces) and deal with it as array of chars?
You can use gets method in C programs to read string with space characters.
#include <stdio.h>
int main()
{
char str[20];
gets(str);
printf("%s", str);
return 0;
}