when you declare an array it's common to use this convention"
int[] var = new int[10]; //bracket in front of the type
I just found out another way that compiles fine, but I dont know the difference:
int var[] = new int[10]; //brackets in front of the varable instead of the type
What's the difference between the two?
[size="4"]-- [size="4"]Stuart, [size="2"]Currently: Messing with LibGDX (Java)
aspiring video game programmer. (follow @mastrgamr)
Programming on and off since 2008 in C++, and C# (XNA).
Attending college as a Computer Science major.
As a side note, if you're planning on writing portable code, avoid using the word "var" as a symbol.
In C# and JScript, said word is used to declare a variable, type of which gets implicitly determined by its initial assigned value (as opposed to manually typing the declaration).
As a side note, if you're planning on writing portable code, avoid using the word "var" as a symbol.
I realize this . just used as an example here.
Thanks for the replies everyone.
[size="4"]-- [size="4"]Stuart, [size="2"]Currently: Messing with LibGDX (Java)
aspiring video game programmer. (follow @mastrgamr)
Programming on and off since 2008 in C++, and C# (XNA).
Attending college as a Computer Science major.