Address of a variable: Difference between revisions
Content added Content deleted
m (Spelling/grammar.) |
m (Changed over to works with template) |
||
Line 20: | Line 20: | ||
'''Platform:''' [[.NET]] |
'''Platform:''' [[.NET]] |
||
⚫ | |||
'''Language Version:''' 2.0+ |
|||
⚫ | |||
=== Get the address === |
=== Get the address === |
||
Note that void* is a "pure" address which doesn't carry the type information anymore. If you need the type information (e.g. to recover the variable itself in a type safe manner), use a pointer to the appropriate type instead; in this case int*. |
Note that void* is a "pure" address which doesn't carry the type information anymore. If you need the type information (e.g. to recover the variable itself in a type safe manner), use a pointer to the appropriate type instead; in this case int*. |
||
Line 34: | Line 31: | ||
=={{header|C}} / {{header|C++}}== |
=={{header|C}} / {{header|C++}}== |
||
{{works with|gcc}}/ [[g++]] |
|||
=== Get the address === |
=== Get the address === |
||
Note that void* is a "pure" address which doesn't carry the type information anymore. If you need the type information (e.g. to recover the variable itself in a type safe manner), use a pointer to the appropriate type instead; in this case int*. |
Note that void* is a "pure" address which doesn't carry the type information anymore. If you need the type information (e.g. to recover the variable itself in a type safe manner), use a pointer to the appropriate type instead; in this case int*. |