Click here to Skip to main content
15,923,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Array pointer lost [modified] Pin
prasad_som14-Feb-07 3:13
prasad_som14-Feb-07 3:13 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 3:24
David Crow14-Feb-07 3:24 
GeneralRe: Array pointer lost Pin
prasad_som14-Feb-07 4:30
prasad_som14-Feb-07 4:30 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 4:40
David Crow14-Feb-07 4:40 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:49
Renato Carvalho14-Feb-07 4:49 
GeneralRe: Array pointer lost Pin
David Crow14-Feb-07 4:55
David Crow14-Feb-07 4:55 
GeneralRe: Array pointer lost Pin
prasad_som14-Feb-07 17:26
prasad_som14-Feb-07 17:26 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:31
Renato Carvalho14-Feb-07 4:31 
That's the result:

int test (tpteste ** l)
{
*l = new tpteste[4]; //error C2228: left of '.i' must have class/struct/union type
*l[0].i = 99; //error C2228: left of '.i' must have class/struct/union type
*l[1].i = 98; //error C2228: left of '.i' must have class/struct/union type
*l[2].i = 97; //error C2228: left of '.i' must have class/struct/union type
*l[3].i = 96; //error C2228: left of '.i' must have class/struct/union type

return 0;
}

int doNothing(void)
{
int j = 0;
tpteste * w;
j = test(w); //error C2664: 'test' : cannot convert parameter 1 from 'tpteste *' to 'tpteste ** '
return 0;
}

In fact, it did not compile. But i will try to work on "pointer to pointer" solution. It's been a long time since i studied C at graduation, and i think a forgot some important points.
But thanks for answering.
GeneralRe: Array pointer lost Pin
toxcct14-Feb-07 4:36
toxcct14-Feb-07 4:36 
AnswerRe: Array pointer lost Pin
prasad_som14-Feb-07 17:21
prasad_som14-Feb-07 17:21 
AnswerRe: Array pointer lost Pin
toxcct14-Feb-07 3:16
toxcct14-Feb-07 3:16 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:41
Renato Carvalho14-Feb-07 4:41 
GeneralRe: Array pointer lost Pin
toxcct14-Feb-07 4:44
toxcct14-Feb-07 4:44 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 4:55
Renato Carvalho14-Feb-07 4:55 
GeneralRe: Array pointer lost [modified] Pin
toxcct14-Feb-07 4:59
toxcct14-Feb-07 4:59 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 5:04
Renato Carvalho14-Feb-07 5:04 
GeneralRe: Array pointer lost Pin
toxcct14-Feb-07 5:08
toxcct14-Feb-07 5:08 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 5:17
Renato Carvalho14-Feb-07 5:17 
AnswerRe: Array pointer lost Pin
David Crow14-Feb-07 5:01
David Crow14-Feb-07 5:01 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 5:33
Renato Carvalho14-Feb-07 5:33 
GeneralRe: Array pointer lost Pin
Renato Carvalho14-Feb-07 5:45
Renato Carvalho14-Feb-07 5:45 
AnswerRe: Array pointer lost Pin
Michael ZY14-Feb-07 16:28
Michael ZY14-Feb-07 16:28 
QuestionDebug Without other Threads Stopped! Pin
reza matinnejad14-Feb-07 2:59
reza matinnejad14-Feb-07 2:59 
AnswerRe: Debug Without other Threads Stopped! [modified] Pin
toxcct14-Feb-07 3:12
toxcct14-Feb-07 3:12 
Questionediting read-only files Pin
ibtt114-Feb-07 2:52
ibtt114-Feb-07 2:52 

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.