Why can't I access any members?

Within my main function I instantiate one of my classes like so:

List sortedList();

The List class has a constructor with no parameters. When I try to use the sortedList object that I've created, my compiler says there are 'no members available.' What might be some reason my object can't use its members? This is what I'm trying to do that isn't working:

1
2
List sortedList();
sortedList.insert(0,22); // doesn't let me access insert 
Last edited on
Hi
First of all you dont need () so it should be like List sortedList; when using default parameter.

and second

The Method insert must be public, and must take two params

hope it help
Last edited on
Topic archived. No new replies allowed.