Why char s1[] and char *s2 Aren’t the Same: Deep Dive into C Arrays vs Pointers
This article explains the fundamental differences between C arrays and pointers by examining memory layout, mutability, sizeof behavior, function parameter handling, multidimensional arrays, and practical best‑practice guidelines, providing clear code examples that reveal why declarations like char s1[] = "liangxu" and char *s2 = "liangxu" behave differently.
