PDA

View Full Version : c++ help


JM^3
25-10-2005, 15:32:10
what does "wrong member access operator" usually mean?

M

fp
25-10-2005, 16:20:33
It means the wrong member is trying to access the operator.

JM^3
25-10-2005, 16:22:51
I didn't tell the wrong member to access the operator

those members are going to have a talking to

JM

Sir Penguin
25-10-2005, 20:51:19
I don't know. Can you give a little more context? Sounds like a problem with operator overloading (or passing an incorrect type to an operator).

SP

LoD
25-10-2005, 21:40:37
Perhaps you mixed up the -> operator with the :: operator?

JM^3
26-10-2005, 13:50:06
I was using an interpreter.. and sometimes you could use . and -> interchangeably.. and sometimes not

so I got that straightened out.. now I have an issue with a segmentation violation (and the code looks exactly like what I had before that worked)

JM

Sir Penguin
26-10-2005, 15:37:13
Segmentation violation means that you're accessing protected memory. Usually, you're trying to access or write to something that's actually a NULL pointer, or you've written a value to a pointer instead of to the address pointed to by the pointer or something.

SP

JM^3
27-10-2005, 15:32:47
I got that problem solved...

new one is that I want to do
int foo;
int * poi;
foo = *poi

or something similiar..

I get an error when I do that

Jon Miller

LoD
27-10-2005, 20:19:18
Did you assign a value to the pointer?

JM^3
27-10-2005, 21:01:45
yep

jm

Sir Penguin
28-10-2005, 04:02:14
There's no semicolon at the end of the last statement.

SP

JM^3
28-10-2005, 04:47:45
yeah, ignore that

I have that taken care of

JM
(I think.. but that is the sort of thing that you just have to scan for.. also the error is not the type as from a missinog ;, I have done that plenty of times when I first started a month ago)

LoD
28-10-2005, 08:24:48
Originally posted by JM^3
yep

jm

HOW did you assign a value to the pointer then :)? Show us that line of code.

JM^3
28-10-2005, 15:57:05
t1-SetBranchAddress(name.Data(), input_num);

where input_num is the pointer

JM

LoD
28-10-2005, 21:03:57
And what does the SetBranchAddress function do?