Click here to Skip to main content
16,005,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: detect invalid reference Pin
Stephen Hewitt14-Feb-07 11:46
Stephen Hewitt14-Feb-07 11:46 
AnswerRe: detect invalid reference Pin
Nemanja Trifunovic14-Feb-07 14:34
Nemanja Trifunovic14-Feb-07 14:34 
QuestionC->C++ ported app - unresolved externals Pin
nadiric14-Feb-07 5:04
nadiric14-Feb-07 5:04 
AnswerRe: C->C++ ported app - unresolved externals Pin
nadiric14-Feb-07 5:17
nadiric14-Feb-07 5:17 
GeneralRe: C->C++ ported app - unresolved externals Pin
John R. Shaw14-Feb-07 8:39
John R. Shaw14-Feb-07 8:39 
QuestionRegistering ActiveX ctrls on PC & Embedded platforms Pin
Like2Byte14-Feb-07 3:34
Like2Byte14-Feb-07 3:34 
AnswerRe: Registering ActiveX ctrls on PC & Embedded platforms Pin
Like2Byte14-Feb-07 5:37
Like2Byte14-Feb-07 5:37 
QuestionArray pointer lost Pin
Renato Carvalho14-Feb-07 2:59
Renato Carvalho14-Feb-07 2:59 
Hi,
I'm new to C++ programming, and i'm having a problem passing pointer to array.
Here is the code:

typedef struct {
int i;} tpteste;

int test (tpteste * l)
{
l = new tpteste[4];
l[0].i = 99;
l[1].i = 98;
l[2].i = 97;
l[3].i = 96;

return 0;
}

int doNothing(void)
{
int j = 0;
tpteste * w;
j = test(w);
return 0;
}

When the "test" function returns, there's nothing in the pointer "w". It does not change it's value.
It may be a dummy question, but i'm having a bad time here with it...
Thanks in advance.


Renato Carvalho.
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 
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 

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.