0

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.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by mvmalderen
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.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.