scanf v.s. assign string directively

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> #include <stdlib.h> int main(void) { char *s = "Hi!"; char *t = "Hi!"; char *x = malloc(5); char *y = malloc(5); printf("x: "); scanf("%s", x); printf("y: "); scanf("%s", y); if (s == t) { puts("s, t: Same"); } else { puts("s, t: Different"); } if (x == y) { puts("x, y: Same"); } else { puts("x, y: Different"); } }
Editor Settings
Theme
Key bindings
Full width
Lines