954,480 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Passing an integer by adress

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:

insert_sorted(&VH, &L, n);


Here is my function:

void insert_sorted(VirtualHeap *VH, LIST *A, char element)
{
	  int *ctr, index;
	  index = MyMalloc(&(*VH));
	  VH->H[index].elem = element;

	  for(ctr = A; *ctr != -1 && VH->H[*ctr].elem < VH->H[index].elem; ctr = &VH->H[*ctr].next);

	  VH->H[index].next = *ctr;
	  *ctr = index;
 }

LIST is integer. I typedef it.

This list is a cursor-based implementation.

Whilliam
Junior Poster
112 posts since Oct 2008
Reputation Points: 19
Solved Threads: 0
 

problem solved!!!

Whilliam
Junior Poster
112 posts since Oct 2008
Reputation Points: 19
Solved Threads: 0
 
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 :P)), having the same problem can see how to fix their problem.

tux4life
Nearly a Posting Maven
2,350 posts since Feb 2009
Reputation Points: 2,134
Solved Threads: 243
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You