|
| ||||||||||
| Tags: array of pointers, arrays, object, pointer array, programming |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Pointer to an array of pointers
- pointer array? A pointer to a pointer does not mean anything. It is always a pointer to something (an object ) - pointer to array of pointers? - table of pointers to arrays? - Difference between pointer to an array and array of pointers? |
|
#2
| ||||
| ||||
| Re: Pointer to an array of pointers
Use pointer to pointer integers : Code: #include <iostream.h>
int main()
{
// int * (arr *) [10]; this is not correct
int **aa; // use this trick
int k;
aa=new int*[3];
for(j=0;j<3;j++)
aa[j]=new int[4];
return 0;
} |
|
#3
| ||||
| ||||
| Re: Pointer to an array of pointers
Pointer to an array of pointers : Code: # include <stdio.h>
# define N 3
int main (void)
(
/ * Array of pointers to char * /
char * t [N] = ( "RAM", "the", "C");
/ * P is a pointer to an array of pointers to char and
initialized at t above * /
char * (* p) [N] = & t;
int i;
for (i = 0; i <N; i + +)
printf ( "% s", (* p) [i]);
printf ( "\ n");
return 0;
) |
|
#4
| |||
| |||
| Re: Pointer to an array of pointers
Pointer to an array : Code: # include <stdio.h> # define N 3 int main (void) ( int t [2] [N] = ((14, 19, 15), (21, 11, 2009)); int (* p) [N] = & t [1]; printf ( "% d \ n", (* p) [2]); return 0; ) Code: # include <stdio.h> # define N 3 int main (void) ( int t0 [5] = (55, 33, 75, 21, 29); int t1 [5] = (8, 23, 45, 54, 69); / * P is an array of 2 pointers to tables 5 int * / int (* p [2]) [5]; / * Test * / p [0] = & t0; p [1] = & t1; printf ( "% d% d \ n", (* p [0]) [3], (* p [1]) [4]); return 0; ) |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Pointer to an array of pointers" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing Stylus pointer to normal Pointer in Tablet PC | Kelley | Portable Devices | 3 | 21-06-2011 07:22 PM |
| How to use void pointer to generate 2D Array in c++ | Conraad | Software Development | 4 | 06-02-2010 04:14 PM |
| Differentiation between void pointer and null pointer | Ram Bharose | Software Development | 5 | 18-01-2010 11:11 AM |
| Size of a pointer to an array of char | Zool | Software Development | 3 | 14-10-2009 12:05 PM |
| Pointer to an array of structures | Zool | Software Development | 3 | 13-05-2009 10:51 PM |