Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Global pointer pointing to locally defined type
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Andrej Prsa, post: 1705679"] Hi! What happens to a globally defined pointer, e.g. void *value; that points to a particular type in a function: int dummy_func (int a) { value = &a; return 0; } after the function returns to main? If this doesn't work, how could I make it work? Do I have to allocate memory for this int and copy the original int to that and then point value to this newly allocated int? Thanks for your time, Andrej [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Global pointer pointing to locally defined type
Top