#include<iostream>;
using namespace std;
int main(){
char arr[8]={};
for(int count(0); count<=7; ++count){
arr[count]='*';
}
cout<<arr;
cin.get();
return 0; }
I really do not understand how some garbage values get stored into the array; even after I have initialized it properly; and how it can display MORE values than what I have stored into it; like if my array size for character array is 10; it will show more than that !!
I use Dev C++ to write, compile my code.
I have attached the code; that I run.
In the below code; 3-4 EXTRA values get displayed as well; they are useless characters; I am not sure where they come from !!