Originally Posted by
jimblumberg
The problem is that the pointer is local to the function and will only be valid in that function.
Does it make any sense ?
function pass integer pointer and return integer pointer
Code:
#include <stdio.h>
int* fp(int *value);
int main(void) // The function main() returns an int, not void.
{
int use_meaningful_variable_names;
fp(&use_meaningful_variable_names);
printf("value - %d", use_meaningful_variable_names);
}
// function pass integer pointer and return integer pointer
int* fp(int *value)
{
*value = 20;
printf("value - %d \n", *value);
printf("address of value - %p \n", value);
return value;
}
when function will execute it will give result that is memory address or pointer that I want to show how to get result of function