2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Murtan
0

Why not just 'add' the records you want in main, after you construct the list?

int main()
{
    List test;

    test.InsertEmployee("Michael bay",1234,"Design");
    test.InsertEmployee("Enrique",5678,"Production");
    test.InsertEmployee("Fernando ",9012,"Management");
   
    test.DisplayList();
    getch();
    return 0;
}

Note that DisplayList() as written is broken and will only display one record.

I think that InsertEmployee() will work, though it could be simplified a little.

An alternative to the above hard-coded calls to InsertEmployee would be to get the data to add from the array you built, but you're going to have to call InsertEmployee for each of the data items anyway.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.