RE: not sure where to post this question... bit C++ implementation specific....

"Richard Fabian" <[email protected]>
Newsgroups gmane.games.devel.general
Message-ID <000801c463ff$3c31e650$03f57c90@bsfabs>
You've got to admit this is a bit of a stinker, and i can't see why the
c++ langauge cannot cope with this simple premise.

At the moment, the best compromise we can come up with is to #ifdef
VALUE #error#else#define VALUE 12.5f#endif
... do stuff with the constant ...
#undef VALUE

we've got a good thing going on about not polluting the namespace, and
#defines can wreak havok on anything that hits them.

------------------
On the other hand
I may be talking
complete drivel.
------------------ 

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On 
> Behalf Of Jorrit Tyberghein
> Sent: 07 July 2004 09:17 AM
> To: [email protected]
> Subject: Re: [GD-General] not sure where to post this 
> question... bit C++ implementation specific....
> 
> 
> Richard Fabian wrote:
> 
> >its a bit C++ specific, but does anyone know of a way of getting the 
> >"meaning" of this to compile...
> >
> >const float ropeLength = 12.5f;
> >const float knotSpace = 3.3f;
> >int array[ ropeLength / knotSpace ];
> >
> >... its sorta meaning we have to break our own coding 
> guidlines.... (no 
> >#defines unless truly necessary)
> >
> >  
> >
> Well using #define is one way.
> 
> The only other way is using allocation:
>     int* array = new int[ropeLength / knotSpace];
> But then you must remember to delete[] it later.
> 
> Greetings,
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by Black Hat Briefings & 
> Training. Attend Black Hat Briefings & Training, Las Vegas 
> July 24-29 - 
> digital self defense, top technical experts, no vendor pitches, 
> unmatched networking opportunities. Visit www.blackhat.com 
> _______________________________________________
> Gamedevlists-general mailing list 
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
> Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=557
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.716 / Virus Database: 472 - Release Date: 05/07/2004
 



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Gamedevlists-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-general
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=557
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.