strcmp with pointers not working in C
Why this code isn't working. Just trying to check if the user input is the same as a password char *pass; printf("Write the password: "); scanf("%s", pass); // Because is a pointer the & is out ? if( strcmp( pass , "acopio") == 0) You've not actually allocated any space to put data. Defining a pointer just defines a variable that can hold the address of a block of data, it doesn't allocate the block. You have a couple of options, allocate dynamic memory off the heap to write into and make the pointer point to it. Or use statically allocated memory on the stack and pass the address of it to