Check here corrected-code
#include<iostream>
using namespace std;
int main()
{
int a[10];
for(int i=0; i<10; i++){ // <= i < 10 instead of i == 9
a[i] = 0;
}
for(int i=0;i<10;i++){
cout << a[i] << endl;
}
}
More Related Contents:
- Get error say no match for call in c++ [closed]
- Initialization Order of Class Data Members
- Modular arithmetics and NTT (finite field DFT) optimizations
- Can main function call itself in C++?
- Are the days of passing const std::string & as a parameter over?
- Global memory management in C++ in stack or heap?
- Is there any way to find the address of a reference?
- Creating an input stream from constant memory
- Template specialization of particular members?
- Comparison of C++ unit test frameworks [closed]
- Volatile in C++11
- Use C++ with Cocoa Instead of Objective-C?
- Undefined reference to WinMain (C++ MinGW)
- Create new C++ object at specific memory address?
- Do I really need to implement user-provided constructor for const objects?
- Use of the & operator in C++ function signatures
- what is/are the purpose(s) of inline?
- How to (un)escape strings in C/C++?
- Partial class template argument deduction in C++17
- What does “for(;;)” mean?
- Is a logical right shift by a power of 2 faster in AVR?
- Is it wise to ignore gcc/clang’s “-Wmissing-braces” warning?
- How to write a Float Mat to a file in OpenCV
- How to clone object in C++ ? Or Is there another solution?
- Using bind1st for a method that takes argument by reference
- How to throw std::exceptions with variable messages?
- Performance penalty for working with interfaces in C++?
- Right Justifying output stream in C++
- Conditional compilation based on template values?
- Reference invalidation after applying reverse_iterator on a custom made iterator