What does the rest of the program look like? Because I've never seen myArray.size() used in this context before. Usually people declare a global integer called MAXVALUES or something along those lines and use that number.
EDIT:
Here is an example:
1 2 3 4 5 6 7 8 9 10
#include <iostream>
usingnamespace std;
int main()
{
int myArray[5] = {5, 2, 8, 2541, 58};
for(int i = 0; i < 5; i++)
cout << myArray[i] << "\n";
}
> I have an array that has some numbers and some letters.
An array has either all letters or all numbers.
1 2 3 4 5 6
char c = 'a' ;
int i = c ;
double d = c ;
int array[] = { c /* initialized with an int (char widened to an int) */,
i /* initialized with an int */,
int(d) /* initialized with an int (double narrowed to an int) */} ;
Every object in array[] is an object of type int.
In the absence of a discriminant, the best one can do is:
if the number in the array happens to be the numeric value of a char, print it as a char.
Something like: