So I want to write two variables in the same scanf_s
. Maybe Im not even using the right names to describe what I want because im new to this but basically I want it to come out as this:
What is your last and first name: John Smith
Thank you now I know that your first name is John and your last name is Smith
And what I have written is this:
#include <iostream>
int main(void)
{
char myFirstName[20];
char myLastName[20];
printf("\nWhat is your first and last name: ");
scanf_s("???")
printf("Thank you now I know that your first name is %s", myFirstName); printf(" and your last name
is %s\n",myLastName);
getchar();
return 0;
}
And I dont know how I should write the scanf_s
part to include the two variables (myFirstName
and myLastName
) so it comes out as I want it.