I want to write a piece of code in c language which can give me some result when the input string will coincide with some given value. [
This code does not work can anybody gives me some advice or point to perfect resource. I want to compare the input value with "alex" for example. It seems to me that char alex is not serious, but I have no idea how to do it. Thanks in advance.
Moderators note: please use code tags for pieces of code
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char names[124];
char alex;
printf("enter password\n");
scanf("%s", names);
printf("input names is %s\n", names);
if(names == alex)
{
printf("open document\n");
}
else printf("there is no coincidence");
return 0;
}
Moderators note: please use code tags for pieces of code
Last edited by a moderator: