log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Elsear brings super-fast Networking to Risc PC/A7000/A7000+ (News:)
- Latest hardware upgrade from RISCOSbits (News:)
- Accessing old floppy disks (Gen:3)
- November developer 'fireside' chat on saturday night (News:)
- RISCOSbits releases a new laptop solution (News:4)
- Announcing the TIB 2024 Advent Calendar (News:2)
- RISC OS London Show Report 2024 (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
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
ksattic
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++