MAIN
tst_struct *tst1;
printf("P outside function1: %p \n", tst1); //Output: 0x0
tst_func(tst1);
Function
tst_struct *tst_func(tst_struct *tst1)
{
printf("P from param: %p \n",tst1); // Output 0x0
tst_struct *tst2;
printf("P inside function: %p \n", tst2); // Output 0x7ffeebcf8940
}
I dont understand why that happened.
I did the same thing in both functions.
If i create a variable and check for address on main, without assign any value, result is 0x0.
But if i create any variable inside another function, i receive an addresss.
There is some difference between main and "normal" functions? Thanks