Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas30-Mar-20 3:35
professionalGreg Utas30-Mar-20 3:35 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan30-Mar-20 4:04
mveRichard MacCutchan30-Mar-20 4:04 
GeneralRe: Passing an array as argument to a function Pin
Greg Utas30-Mar-20 4:11
professionalGreg Utas30-Mar-20 4:11 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan30-Mar-20 4:24
mveRichard MacCutchan30-Mar-20 4:24 
GeneralRe: Passing an array as argument to a function Pin
k505430-Mar-20 4:58
mvek505430-Mar-20 4:58 
GeneralRe: Passing an array as argument to a function Pin
k505429-Mar-20 7:52
mvek505429-Mar-20 7:52 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru29-Mar-20 8:11
Calin Negru29-Mar-20 8:11 
GeneralRe: Passing an array as argument to a function Pin
k505429-Mar-20 9:42
mvek505429-Mar-20 9:42 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru30-Mar-20 22:30
Calin Negru30-Mar-20 22:30 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru31-Mar-20 21:36
Calin Negru31-Mar-20 21:36 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan31-Mar-20 23:02
mveRichard MacCutchan31-Mar-20 23:02 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru31-Mar-20 23:26
Calin Negru31-Mar-20 23:26 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 0:36
mveRichard MacCutchan1-Apr-20 0:36 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru1-Apr-20 1:12
Calin Negru1-Apr-20 1:12 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 1:26
mveRichard MacCutchan1-Apr-20 1:26 
No. Pointers are pointers whatever they point at, be it an array or a structure. Think about a piece of memory as a sequence of cells. So a pointer to any cell allows you to access all the following cells in order, by using an index (pointer plus offset). If you (the programmer) have decided that the area you point to should be treated as if it contains different sized blocks (aka a structure), that does not affect the physical properties of the memory. It merely allows the compiler to calculate the distance between the elements of the structure. And an array of pointers is much the same thing.

If you have trouble visualising multi levels of indirection, then always go for a single level. If you have an array of pointers, then create a temporary one and allocate an array entry to it like:
C++
CUSTOMVERTEX ** ScreenLettersP_s = new CUSTOMVERTEX* [NumberOfTextBuffers]; // an array of struct pointers
CUSTOMVERTEX* pTemp = ScreenLettersP_s[0]; // get the first pointer in the array
pTemp-> // now access the struct items.

GeneralRe: Passing an array as argument to a function Pin
Calin Negru1-Apr-20 1:49
Calin Negru1-Apr-20 1:49 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 2:45
mveRichard MacCutchan1-Apr-20 2:45 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru1-Apr-20 5:19
Calin Negru1-Apr-20 5:19 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan1-Apr-20 6:39
mveRichard MacCutchan1-Apr-20 6:39 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru31-Mar-20 4:42
Calin Negru31-Mar-20 4:42 
GeneralRe: Passing an array as argument to a function Pin
Richard MacCutchan31-Mar-20 4:58
mveRichard MacCutchan31-Mar-20 4:58 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru31-Mar-20 5:28
Calin Negru31-Mar-20 5:28 
AnswerRe: Passing an array as argument to a function Pin
Stefan_Lang30-Mar-20 23:18
Stefan_Lang30-Mar-20 23:18 
GeneralRe: Passing an array as argument to a function Pin
Calin Negru31-Mar-20 0:02
Calin Negru31-Mar-20 0:02 
AnswerRe: Passing an array as argument to a function Pin
Calin Negru11-Apr-20 5:13
Calin Negru11-Apr-20 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.