0
Hi guys, how local variable ‘a’ goes outside of function? Is it possible?
#include <iostream> using namespace std; void func(int** nVal) { int a = 10; *nVal=&a; cout<<nVal<<endl; } int main() { int s=20; int* b=&s; cout<<*b<<endl; func(&b); cout<<*b<<endl; cout<<*b; return 0; }
1 ответ