Skip to content

Instantly share code, notes, and snippets.

@mbaranowski
Created April 3, 2013 20:18
Show Gist options
  • Save mbaranowski/5304851 to your computer and use it in GitHub Desktop.
Save mbaranowski/5304851 to your computer and use it in GitHub Desktop.
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