Good afternoon, I use gnu-gcc compiler and it behaves strangely with strings, that is, it simply does not check strings that were assigned via scanf here's the code
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *command; printf("> "); scanf("%s\n", &command); if (command == "qewr") { printf("programm"); } getch(); return 0; } However, it works
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char *command; printf("> "); command = "qewr"; if (command == "qewr") { printf("programm"); } getch(); return 0; }