C++, array, pointer

0. 

1. syntax

int foo[5]; // an array of int, an empty array

int foo[5] = {16, 2, 77, 40, 123}; // an array of int with initilization

int* ptr[5]; // an array of pointer, each pointer points to an int

double *p; // a pointer pointing to a double

 

vector v; // an array of int

vector vp; // array of pointer, each pointer points to an int

你可能感兴趣的:(C++, array, pointer)