About 249,000 results
Open links in new tab
  1. c++ - What is a char*? - Stack Overflow

    Jun 14, 2022 · char const *test = "testing"; I mention this primarily because it's the one you usually really want. The bottom line, however, is that char x; will only define a single character. If you …

  2. 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 …

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

    Dec 15, 2018 · } 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 …

  4. What is char ** in C? - Stack Overflow

    Nov 13, 2012 · Technically, the char* is not an array, but a pointer to a char. Similarly, char** is a pointer to a char*. Making it a pointer to a pointer to a char. C and C++ both define arrays …

  5. 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 …

  6. c++ - char and char* (pointer) - Stack Overflow

    Oct 14, 2012 · Think of char* p; as of address in memory. You did not initialize this pointer so it does not point to anything, you cannot use it. To be safe always: either initialize pointer to …

  7. 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, …

  8. Difference between CR LF, LF and CR line break types

    Oct 12, 2009 · I'd like to know the difference (with examples if possible) between CR LF (Windows), LF (Unix) and CR (Macintosh) line break types.

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

    Feb 24, 2015 · 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 perform …

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

    The declaration and initialization 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 …

Refresh