User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 396,841 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,254 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser:

pointer passing problem

Join Date: Aug 2005
Location: near St Louis, Missouri, USA
Posts: 10,625
Reputation: Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of Ancient Dragon has much to be proud of 
Rep Power: 36
Solved Threads: 865
Moderator
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Most Valuable Poster

Re: pointer passing problem

  #5  
May 2nd, 2008
The only reason to pass a pointer to a pointer is so that the function can change the value of the original pointer that was declared in main().

>>for(i=1;i<= int_tmp;i++)
That line is incorrect. arrays are numbered 0, 1, ... Here is the correction
for(i=0; i < int_tmp; i++)
>>for(i=1;i<=N_Cell_total;i++)
From your original post in main() -- that line is also wrong for the same reason
for(i=0; i < N_Cell_total; i++)
And don't be afraid to make liberal use of white space, it make the code easier to read.
Last edited by Ancient Dragon : May 2nd, 2008 at 8:55 am.
I think it's about time we voted for senators with breasts. After all, we've been voting for boobs long enough. ~Clarie Sargent, Arizona senatorial candidate
Those who are too smart to engage in politics are punished by being governed by those who are dumber. ~Plato
Reply With Quote  
All times are GMT -4. The time now is 2:37 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC