Posted By

lpiaitdepok on 12/20/14


Tagged

c++


Versions (?)

Initializing an array in C++


 / Published in: C++
 

Initializing an array in C++

  1. #include <iostream>
  2. using namespace std;
  3.  
  4. main() {
  5. int n[10];
  6.  
  7. for (int i = 0; i < 10; i++) {
  8. n[i] = 1;
  9. cout<<n[i]<<endl;
  10. }
  11. }

Report this snippet  

You need to login to post a comment.