I'm re-writing a program that used template-functions without the template functions. I receive an error: "subscript is not of integral type" on the second printarray function but the other two work fine. All it should do is pass the decimal numbers to the array but for some reason it is not storing the numbers and returning all of them. If I remove the second function the other two run fine. Can anyone helpwith this ????

Thanks very much.

Novice programmer seeking help :-(

code follows....

#include <iostream>

using std::cout;
using std::endl;

void printarray_a (int a[], int aCount) {
for (int x = 0; x < aCount; x++)
cout << a[x] << " ";
cout << "\n";
}

void printarray_b (double b[], int bCount) {
for (double y = 0; y < bCount; y++)
cout << b[y] << " ";
cout << "\n";
}

void printarray_c (char c[], int cCount) {
for (char z = 0; z < cCount; z++)
cout << c[z] << " ";
cout << "\n";
}

int main ()
{
int a[] = {1, 2, 3, 4, 5};
double b[] = {1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7};
char c[] = "HELLO";

cout << "Array a contains:" << endl;
printarray_a (a,5);

cout << "Array b contains:" << endl;
printarray_b (b,7);

cout << "Array c contains:" << endl;
printarray_c (c,6);

return 0;
}