Re: is there a way to do this...



I don't have a complete code of your error code, and I write a simple
code like yours, it works well and correct. And I think you should
provide some context about your program.

#include <stdio.h>
void change(int *);
int main(void)
{
int i = 5;
printf("1. The integer value is %d.\n", i); //It will print 5
change(&i);
printf("2. The integer value is %d.\n", i); //It will print 23
i = 6;
printf("3. The integer value is %d.\n", i); //It will print 6
system("PAUSE");
return 0;
}
void change(int * pst)
{
*pst = 23;
}

.



Relevant Pages