Created
April 3, 2013 20:18
-
-
Save mbaranowski/5304851 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, const char * argv[]) | |
{ | |
// c++98 | |
int* array[2]; | |
array[0] = new int[5]; | |
array[1] = new int[2]; | |
// c++11 only, 1d initializer | |
int array4[] = {1,2,3,4,5}; | |
int* array3= new int[3]{1,2,3}; | |
// c++11 only, jagged initializer | |
int* array2[] = { | |
new int[3]{1,2,3}, | |
new int[3]{1,2}, | |
new int[3]{1,2,3,4,5,6,7}, | |
new int[3]{1,2,3,4} }; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment