i wanted to compare user input with text in c, but i dont know exactly how. Please help me.
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
char len_input[16];
int input;
void name() {
printf("Enter your name\n");
input = fgets(len_input, sizeof(len_input), stdin);
input;
if (input == "Osas") {
printf("What a stupid name...\n");
}
else {
printf("Cool name dude!\n");
}
}
int main(int argc, char **argv) {
name();
}
I tried this but its not working. Please show it how to do it correctly becaus im new to c. Thanks