About 306,000 results
Open links in new tab
  1. What is the difference between char array and char pointer in C?

    Sep 13, 2019 · As the initializer for an array of char, as in the declaration of char a [] , it specifies the initial values of the characters in that array (and, if necessary, its size). Anywhere else, it …

  2. c++ - What is a char*? - Stack Overflow

    Jun 14, 2022 · A char* stores the starting memory location of a C-string. 1 For example, we can use it to refer to the same array s that we defined above. We do this by setting our char* to the …

  3. c++ - Difference between char* and char [] - Stack Overflow

    Sep 27, 2011 · char str[] = "Test"; Is an array of chars, initialized with the contents from "Test", while char *str = "Test"; is a pointer to the literal (const) string "Test". The main difference …

  4. Difference between char* and char** (in C) - Stack Overflow

    } int main() { char *s = malloc(5); // s points to an array of 5 chars modify(&s); // s now points to a new array of 10 chars free(s); } You can also use char ** to store an array of strings. However, …

  5. c - char *array and char array [] - Stack Overflow

    char *array = "One good thing about music"; declares a pointer array and make it point to a (read-only) array of 27 characters, including the terminating null-character.

  6. Difference between char and char* in c - CS50 Stack Exchange

    Feb 24, 2015 · 50 The difference between char* the pointer and char[] the array is how you interact with them after you create them. If you are just printing the two examples, it will …

  7. c - Difference between char* and const char*? - Stack Overflow

    Mar 23, 2012 · What's the difference between char* name which points to a constant string literal, and const char* name

  8. c - What is the difference between char s - Stack Overflow

    Nov 10, 2009 · This declaration: char s[] = "hello"; Creates one object - a char array of size 6, called s, initialised with the values 'h', 'e', 'l', 'l', 'o', '\0'. Where this array is allocated in memory, …

  9. What is the difference between char * const and const char

    May 21, 2009 · char* const x is refer to character pointer which is constant, but the location it is pointing can be change. const char* const x is combination to 1 and 2, means it is a constant …

  10. c - Return char []/string from a function - Stack Overflow

    Im fairly new to coding in C and currently im trying to create a function that returns a c string/char array and assigning to a variable. So far, ive observed that returning a char * is the most ...