try something like this:
char *array[3];
char x = 'a', y = 'b', z = 'c';
array[0] = &x;
array[1] = &y;
array[2] = &z;
for (int i=0; i< 3; i++)
printf( "%d = %c\n", i, *(array[i]) );
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
got it to work with windows using cygwin and linux gcc...
is there a specific error or output that happens when you compile or run the code?
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
i want to create array of pointer. "aa" "ab" "ac"
You've forgotten brackets .. {}, i.e.
const char *table[3] = {"aa", "ab", "ac"};
mitrmkar
Posting Virtuoso
1,834 posts since Nov 2007
Reputation Points: 1,119
Solved Threads: 399
Skill Endorsements: 8