Hi I have work for school where I have to initialize an integer array called data
with the values 5,6,-3,2,0 in a single statement. I am not sure if you can initialize arrays with specific numbers I am wondering if it just means to declare it i.e
or to initialize an array of 4 i.e
with the values 5,6,-3,2,0 in a single statement. I am not sure if you can initialize arrays with specific numbers I am wondering if it just means to declare it i.e
Code:
int data[] = { 5, 6, -3, 2, 0 }
Code:
for ( int i = 0; i < 4; i++ )
data[ i ] = 0;