hiii
can you please tell how to return pointers from functions?
why this code doesn't works?
[CODE=cpp]#include <iostream.h>
char* fn_name(int i)
{
char c = itoa(i);
return &c;
}
int main()
{
int i = 10;
char* ch_ptr;
ch_ptr = fn_name(i);
cout<<&ch_ptr<< endl;
}[/CODE]
can you please tell how to return pointers from functions?
why this code doesn't works?
[CODE=cpp]#include <iostream.h>
char* fn_name(int i)
{
char c = itoa(i);
return &c;
}
int main()
{
int i = 10;
char* ch_ptr;
ch_ptr = fn_name(i);
cout<<&ch_ptr<< endl;
}[/CODE]
Comment