#include <stdio.h> int main () { int var1; char var2[10]; printf("Address of var1 variable: %x\n", &var1 ); printf("Address of var2 variable: %x\n", &var2 ); return 0; }
The above code exists in order to print the address values of the variables in your code. And afterwards when you compile said code it will produce this in the console:
Address of var1 variable: bff5a400 Address of var2 variable: bff5a3f6
As extra information gathered by the C programming book by (Richard.R, 2013.), meaning it's a very reliable source since it was written by an official published author, Pointers can help make your code much shorter and more compact, meaning that the compiler has less code to process and thus the program will run more efficiently. When using C# any programmer should consider using these, as down the line with hundreds of thousands of lines of code n your game they can work very well for optimization of your creation, and will allow to run on lower-end hardware, and thus you'll be following a more professional working standard.
No comments:
Post a Comment