I'm taking my fist steps in programming and i was trying to make a program that takes as imput your username and and prints it out as output. I wanted to implement an if statement that triggers when you imput spaces instead of characters inside the scanf, but i can't seem to get it working? is it possible to do or is it impossible for an array of characters? Thaks for your help!
char username[20]; //declares a 20 chars array for the username to be stored
printf("\nPlease input your Username\nUsername:"); //asks for the username
scanf("%s", &username); //inserts username inside array "username"
if(username == ' '){ //supposedly the guard to my if
printf(("invalid imput"));
}
printf("%s",username);