Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using pointer

Status
Not open for further replies.

jayjay60

Programmer
Jun 19, 2001
97
FR
In my application, i have a member variable double *m_pTab.
firstly, i have created a function which take 1 parameter(parameter1) which be used to allocate memory as follow: m_pDate=new double[parameter1], and after, in the same function, i modify the value of the pointer. For example, *(m_pTab+i)=value_i;
Now, i would like to use this member pointer in another function with the affectation done above, it's my pb, because i don't know how looks like the syntax of this kind of operation.
So, is anybody could explain me how to solve my problem?

thanks in advance

jayjay
 
I am a bit confused. Is m_pTab an array? If it is not, it should be with the way you are treating it

*(m_pTab+i)=value_i;

could you please post whether or not it is an array and possibly describe your problem a bit more clearly?

From what I could assume, you have a second function in the class which will use m_pTab. If m_pTab is an array you need to keep track of where in that array you want to access with the afformentioned function. If it is not an array you will just use m_pTab

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top