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++ help!
 
  C++ help!
  (12:01 18/4/2001)
  johnstlr (12:06 18/4/2001)
    Phlamethrower (16:14 18/4/2001)
 
Phlamethrower Message #4759, posted at 12:01, 18/4/2001
Unregistered user I've stumbled across the following problem in some code I've been writing for Coder's Cauldron.

There's a class (Called ae) which uses rglApp pointers as a parameter in almost every function call. An rglApp is a struct, which contains numerous ae pointers.

That's where the problem lies - how can I define the ae and rglApp, without causing an error from not having the other one defined already? I'd rather not replace any of the pointers with voids, since the pointers get used so often in the code.

Would it be possible to, say, define the rglApp once using voids, then redefine it using ae's?

Any help would be greatly appreciated.

  ^[ Log in to reply ]
 
johnstlr Message #4760, posted at 12:06, 18/4/2001, in reply to message #4759
Unregistered user You can do a forward declaration of the class. I can't remember the exact syntax but it's something like

class ae;

struct rglApp
{
ae *pAe;
...
}

class ae
{
...
}

I'm a little curious as to how you got into this situation though. What is the relationship between rglApp and ae?

  ^[ Log in to reply ]
 
Phlamethrower Message #4761, posted at 16:14, 18/4/2001, in reply to message #4760
Unregistered user Thanks.

I'm a little curious as to how you got into this situation though. What is the relationship between rglApp and ae?

The ae's are the active edge list entries, and quite often they need to check whether they are the first item in the list (E.g. when the list is sorted). The pointer to the first item is kept in the rglApp, so in order for this to be correct the ae must know which rglApp to use.

  ^[ Log in to reply ]
 

Acorn Arcade forums: Programming: C++ help!