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.

problem solved!!!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.