im trying to make a program where the user is asked a username,after he enters it he is greeted, and then he has to type a word to enter(in this case "confirm") and i need help with how to make the program check what the user will input so it knows if its correct or not...here's what ive done so far.
Code:
#include <stdlib.h>
#include<windows.h>
int main()
{
COORD c;
c.X = 40;
c.Y = 15;
SetConsoleCursorPosition(
GetStdHandle(STD_OUTPUT_HANDLE), c);
char username[20];
printf("Enter a username :");
scanf("%[^\n]s", &username);
printf("Welcome %s\n", username);
printf("This is a test\n");
printf("Type 'confirm' to enter");
return 0;
}