The first creates an array of char containing the string. The contents of the array can be modified. The second creates a character pointer which points to a string literal. String literals cannot be modified.
More Related Contents:
- Difference between char *str=”STRING” and char str[] = “STRING”?
- Literal string initializer for a character array
- C array pointer increment
- c search for target string in string [closed]
- Pointers program
- C prog. Pointers and strings [closed]
- Is an array name a pointer?
- With arrays, why is it the case that a[5] == 5[a]?
- Returning an array using C
- What does sizeof(&array) return?
- In C, are arrays pointers or used as pointers?
- Using the equality operator == to compare two strings for equality in C [duplicate]
- Exceptions to array decaying into a pointer?
- Why do arrays in C decay to pointers?
- Pointer address in a C multidimensional array
- Why doesn’t scanf need an ampersand for strings and also works fine in printf (in C)?
- Returning Arrays/Pointers from a function
- why is array name a pointer to the first element of the array?
- Passing two-dimensional array via pointer
- Getting the size of a malloc only with the returned pointer
- How to find the size of an array (from a pointer pointing to the first element array)?
- Segmentation fault occurring when modifying a string using pointers?
- When is an array name or a function name ‘converted’ into a pointer ? (in C)
- Why can’t I treat an array like a pointer in C?
- Pointer to 2D arrays in C
- What’s the difference between array and &array?
- How to calculate size of array from pointer variable?
- Pointer expressions: **ptr++, *++*ptr and ++**ptr use
- C split a char array into different variables
- C pointer notation compared to array notation: When passing to function