I have this 2 functions
myfunction1 (myclass &value)
myfunction2 (int &value)
I want to pass the values by ref to avoid copies.
Ok, I have a object created like this
a_struc * my_struc= new a_struc;
(a_struc is a simple struct with 3 fields, the third is an int field called a3. )
myfunction1(*mystruc) works
myfunction2(*mystruc->a3) does not compile
myfunction2(mystruc->a3) compile, but inside myfunction2 I have :
int si = sizeof value; and in this last case I have an error ....(programs crash)
Any help? Thanks




Reply With Quote
Bookmarks