RE: not sure where to post this question... bit C++ implementation specific....
"Richard Fabian" <[email protected]>
| Newsgroups | gmane.games.devel.general |
|---|---|
| Message-ID | <000701c463fe$290457d0$03f57c90@bsfabs> |
> >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) > Hi > > AFAIK the number of tokens in an array must be an integer . > An easy solution could be to compute the division in a temp > variable then see if it give us a modulo ,if yes increase by > one our result > and finally use that result to create the array. > > GC. that, my friend is not the problem... i wouldn't be much of a coder if i thought i could have "pi" elements in my array... The problem is that as long as there is a "const float" involved, the compiler will not listen to the fact that it is a const. e.g. if i replace "int array[ ropeLength / knotSpace ];", with "int array[ int(ropeLength / knotSpace) ];", or "int array[ (int)(ropeLength / knotSpace) ];", there is still a compilation error. --- 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