How can I read the input as string (with spaces) and deal with it as array of chars?
created
last reply
- 3
replies
- 931
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;
}
Topic | Category | Replies | Views | Activity |
---|---|---|---|---|
SPTTRN1 - Straight Line Spiral Pattern (Act 1) | C and C++ | 0 | 13 | 6d |