Acorn Arcade forums: Programming: waiiiil++
|
waiiiil++ |
|
instantiator (10:49 30/5/2005) ksattic (22:11 31/5/2005) instantiator (10:20 18/7/2005)
|
|
Lewis Westbury |
Message #66070, posted by instantiator at 10:49, 30/5/2005 |
Member
Posts: 365
|
C++
I've declared a class called ReservationList private to this class is the struct tm start replaced the default constructor with (a public) one that maniupulates start
from my main fuction, I declare (and therefore default constructor initialise) a ReservationList; and the compiler says no:
distributor.cpp: In function `int main()': distributor.cpp:5: error: `tm ReservationList::start' is private distributor.cpp:52: error: within this context
any suggestions? i thought that private/protected stuff was available to functions of the same object/class
[Edited by instantiator at 11:49, 30/5/2005] |
|
[ Log in to reply ] |
|
Simon Wilson |
Message #66136, posted by ksattic at 22:11, 31/5/2005, in reply to message #66070 |
Finally, an avatar!
Posts: 1291
|
Can you include your code? It's hard to see what the problem is when I can't see what the errors at lines 5 and 52 are in regard to.
The compiler says the errors are in the int main() function, which is outside your class. |
|
[ Log in to reply ] |
|
Lewis Westbury |
Message #67764, posted by instantiator at 10:20, 18/7/2005, in reply to message #66136 |
Member
Posts: 365
|
Can you include your code? It's hard to see what the problem is when I can't see what the errors at lines 5 and 52 are in regard to.
The compiler says the errors are in the int main() function, which is outside your class. Turns out I hadn't put a semicolon at the end of a { bracketed } definition. (You win this time, bad Java habits...) |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: waiiiil++ |