tiw
11-20-2000, 12:56 AM
does anyone know how to pass a pointer from a function in C. what i got now is this, will this correctly set test to five?
void function(int *);
int main(){
int * test;
function(test);
printf("%d\n",test);
return 0;
}
void function(int * test){
*test=5;
}
void function(int *);
int main(){
int * test;
function(test);
printf("%d\n",test);
return 0;
}
void function(int * test){
*test=5;
}