Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

variable-sized object may not be initialized

Name: Anonymous 2006-02-14 11:10

//int main()
//{
//    int n;
//   
//    cout << "Welcome to a much better class demo!" << endl
//         << "How many employees do you want to index?" << endl;
//    cin  >> n;
//   
//    const int EMS = n;
//   
//    Employee theEmployees[EMS]=
//    {
//         Employee(),
//    };
//}

For some reason this gives me the error "variable-sized object 'theEmployees' may not be initialized"

It works fine with an absolute numerical value for the array size, not sure why the variable won't work.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List