I am using scanf_s to two different inputs and place them into char arrays. I have attached the code and the output it gives
char firstName[30];
char lastName[30];
int main() {
// Input Name
printf("Please input your name: ");
scanf_s("%s %s", firstName, 30, lastName, 30);
printf("%s %s", firstName[30], lastName[30]);
_getch();
return 0;
}
the output is:
Please input your name: Jane Smith
(null) (null)
any help to this problem would be great because any scanf_s that I do won't work and its driving me crazy.