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
- R-Comp releases Genealogy v2 (News:)
- Will we see 5.30 released at Wakefield show? (News:1)
- Sine Nomine updates RiscOSM and Impact (News:)
- Netfetch version 5.55 released (News:)
- Prizes for Wakefield Show announced (News:)
- Heretic update from R-Comp (News:)
- Wakefield Show 2024 is next Saturday (News:)
- Git client updated to 0.07 (News:2)
- Archive Edition 27:1 reviewed (News:)
- Rougol April 2024 meeting on monday is Anniversary time (News:1)
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
The Icon Bar: Programming: C++ forward decleration
 
  C++ forward decleration
  (01:00 8/8/2001)
  monkeyson (09:26 8/8/2001)
    johnstlr (09:31 8/8/2001)
    Gulli (12:32 8/8/2001)
 
Gulli Message #4809, posted at 01:00, 8/8/2001
Unregistered user I have a problem with Acorn C/C++ v. 5.

I'm creating a class that's supposed to be double linked but I can't get it to compile.

The code is something like this:


class Abc;

class Abc
{
private:
Abc previous;
Abc next;
};

When compiling it gives me the error 'Abc undefined, size not known'. Is there any way around this?

  ^[ Log in to reply ]
 
monkeyson Message #4810, posted at 09:26, 8/8/2001, in reply to message #4809
Unregistered user What if you use pointers, eg Abc* previous?
  ^[ Log in to reply ]
 
johnstlr Message #4811, posted at 09:31, 8/8/2001, in reply to message #4810
Unregistered user Yes he should be using pointers - and I believe the forward declaration isn't necessary either.
  ^[ Log in to reply ]
 
Gulli Message #4812, posted at 12:32, 8/8/2001, in reply to message #4810
Unregistered user
What if you use pointers, eg Abc* previous?

Hmm, I was intending to use a pointer! Silly me! Thanks

  ^[ Log in to reply ]
 

The Icon Bar: Programming: C++ forward decleration