Hi for some reason my array prints out a bunch of 0's and other unwanted integer garbage. I can't see why because i originally assigned number to an array 1-31 using something like array[]={1, 2,3...31}
something like that, and then i use a for or while loop in the code to print the array using cout, however i get a bunch of 0's i'm confused.
please look over a bit of my code.
int temp=dayselector; //temp will equal 4 or anything
while (temp >= 0)
{
cout << " ";
temp--;
}
int i=0;
while (counter > 0) //counter would be 31
{
if (dayselector < 8)
{
cout << array[counter] << " ";
dayselector++;
counter--;
i++;
}
else
{
cout << "\n";
dayselector=0;
}
}
}