Solve This (? + ? + ?=30)
If 1111=R, 2222=T, 3333=E, 4444=N Then 5555=?
Guess the Hindi Muhawara from the following whatsapp Emoticons?
Sweet, Medicine, Film, Girl, City, Car, Place, Doggy all are name same, guess which word it is?
A girl is blind, deaf, dumb and uneducated too. A boy loves her. How would he propose without touching her?
Four Question, One Answer: One River Name, One Flower Name, One Film Name, One Actress Name?
Guess me who am I, I am the first on earth, the second in heaven...
Which Indian cricketer is known as "Brown Bradman"?
When was the first aircraft brought down by another in the course of World War I?
Which sea or ocean washes into the ports of Suriname?
old_fun() { int a = 10; int *ptr = &a; new_fun(&a); // passing address case 1 new_fun(ptr); // passing address case 2 } new_fun(int *ptr) { *ptr = 50; }
Here, case 1 will affect of "a" of old_fun but case 2 wont affect why ?
Looks that you have missed something I tested the following code
new_fun(int *ptr) { *ptr = 50; } main() { int a = 10; int *ptr = &a; new_fun(&a); printf("%d\n", a); new_fun(ptr); printf("%d\n", a); }
Output
50 50
I actually changed the new_func to this one in Salil's code
new_fun(int *ptr) { (*ptr)++; }
and output was 11 12 so this question does not seems to be valid.
11 12
What is the point of declaring Pointer of different types (eg. integer,float,char) as we all know pointer takes 4 bytes of space regardless which type of pointer it is and only contains address?