Skip to main content
Explain the different char *
Source Link
Prateek Pande
  • 206
  • 1
  • 2
  • 9

difference between --

char a[SIZE] chara[SIZE]; //Char array of size (SIZE)

char *a; char //character pointer. Points towards a char (a).

char *a[SIZE]; char // Array of pointer characters.

char *(a[SIZE]); char // Pointer to an array of characters.

char (*a[SIZE]);

ARE char *a[SIZE]; and char (*a[SIZE]); EQUIVALENT ?? And we also say string a; is actually char *a;. So the later is a pointer to a character , which when initialised stores address of char a. So how it acts as a string? Isn't it just a variable storing address of a single character. Similar to int *i. Which is a pointer to an integer not an array of integers.

Very confused !!!!

difference between --

char a[SIZE] char *a; char *a[SIZE]; char *(a[SIZE]); char (*a[SIZE]);

ARE char *a[SIZE]; and char (*a[SIZE]); EQUIVALENT ??

difference between --

char a[SIZE]; //Char array of size (SIZE)

char *a; //character pointer. Points towards a char (a).

char *a[SIZE]; // Array of pointer characters.

char *(a[SIZE]); // Pointer to an array of characters.

char (*a[SIZE]);

ARE char *a[SIZE]; and char (*a[SIZE]); EQUIVALENT ?? And we also say string a; is actually char *a;. So the later is a pointer to a character , which when initialised stores address of char a. So how it acts as a string? Isn't it just a variable storing address of a single character. Similar to int *i. Which is a pointer to an integer not an array of integers.

Very confused !!!!

Source Link
Prateek Pande
  • 206
  • 1
  • 2
  • 9

different between pointers and pointer to arrays?

difference between --

char a[SIZE] char *a; char *a[SIZE]; char *(a[SIZE]); char (*a[SIZE]);

ARE char *a[SIZE]; and char (*a[SIZE]); EQUIVALENT ??