Passing an integer by adress

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Oct 2008
Posts: 61
Reputation: Whilliam is an unknown quantity at this point 
Solved Threads: 0
Whilliam's Avatar
Whilliam Whilliam is offline Offline
Junior Poster in Training

Passing an integer by adress

 
0
  #1
Jul 9th, 2009
Hello.. Im trying to pass an integer to a function by adress because I want to change the value of the integer in the function. But it will not.. please help.

Here is my function call:
  1. insert_sorted(&VH, &L, n);

Here is my function:
  1. void insert_sorted(VirtualHeap *VH, LIST *A, char element)
  2. {
  3. int *ctr, index;
  4. index = MyMalloc(&(*VH));
  5. VH->H[index].elem = element;
  6.  
  7. for(ctr = A; *ctr != -1 && VH->H[*ctr].elem < VH->H[index].elem; ctr = &VH->H[*ctr].next);
  8.  
  9. VH->H[index].next = *ctr;
  10. *ctr = index;
  11. }
LIST is integer. I typedef it.

This list is a cursor-based implementation.
Last edited by Whilliam; Jul 9th, 2009 at 11:03 am.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 61
Reputation: Whilliam is an unknown quantity at this point 
Solved Threads: 0
Whilliam's Avatar
Whilliam Whilliam is offline Offline
Junior Poster in Training

Re: Passing an integer by adress

 
0
  #2
Jul 9th, 2009
problem solved!!!
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 1,968
Reputation: tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute tux4life has a reputation beyond repute 
Solved Threads: 214
tux4life's Avatar
tux4life tux4life is offline Offline
Posting Virtuoso

Re: Passing an integer by adress

 
0
  #3
Jul 9th, 2009
Originally Posted by Whilliam View Post
problem solved!!!
Maybe in future, you could mention how you solved your problem, so others, who get to this page (for example by using Google (everyone's friend )), having the same problem can see how to fix their problem.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 266 | Replies: 2
Thread Tools Search this Thread



Tag cloud for C
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC