Is there a way to set an initializing value for every element in an array?
I have a type int array and need a way to set every value to 0. How can this be done?
It's not specific to Dev-C++ (which is just an IDE - you mean GCC/MinGW).
The elements of the array you provide no initializers for are always default-initialized in this case.
#include <iostream>
usingnamespace std;
int main () {
constint n = 10;
int v[n]={};
int i;
for (i = 0; i < n; i++)
cout<<v[i]<<endl;
cin.get(); cin.get();
return 0;
}