I've a problem and I couldn't find answer.
I need to get 2 strings from user using scanf(must) and print them.
I have 2 problems 1. when I type the first string it's somehow skip the second one. 2. if my string includes spaces, I takes only the chars till the space, from what I think the 2nd word goes to the second "scanf"
this is my code
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void main()
{
char format[30];
char numbers[20];
scanf("%s", format);
scanf("%s", numbers);
printf("\n %s %s", format, numbers);
}
is it possible to get 2 strings from user 1 after another including spaces? Thanks in advance