943,714 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 417
  • C RSS
Jul 9th, 2009
0

Passing an integer by adress

Expand Post »
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.
Similar Threads
Reputation Points: 19
Solved Threads: 0
Junior Poster
Whilliam is offline Offline
110 posts
since Oct 2008
Jul 9th, 2009
0

Re: Passing an integer by adress

problem solved!!!
Reputation Points: 19
Solved Threads: 0
Junior Poster
Whilliam is offline Offline
110 posts
since Oct 2008
Jul 9th, 2009
0

Re: Passing an integer by adress

Click to Expand / Collapse  Quote originally posted by Whilliam ...
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.
Reputation Points: 2125
Solved Threads: 243
Postaholic
tux4life is offline Offline
2,105 posts
since Feb 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: linked list (another problem)
Next Thread in C Forum Timeline: Problem with memory free in C





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC