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:)
- Announcing the TIB 2024 Advent Calendar (News:1)
- Code GCC produces that makes you cry #12684 (Prog:39)
- RISCOSbits releases a new laptop solution (News:)
- Rougol November 2024 meeting on monday (News:)
- Drag'n'Drop 14i1 edition reviewed (News:)
- WROCC November 2024 talk o...ay - Andrew Rawnsley (ROD) (News:2)
- October 2024 News Summary (News:3)
- RISC OS London Show Report 2024 (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
Acorn Arcade forums: Programming: C++ forward decleration
 
  C++ forward decleration
  (00:00 8/8/2001)
  monkeyson (08:26 8/8/2001)
    johnstlr (08:31 8/8/2001)
    Gulli (11:32 8/8/2001)
 
Gulli Message #4809, posted at 00: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 08: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 08: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 11: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 ]
 

Acorn Arcade forums: Programming: C++ forward decleration