• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: why does this not work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why does this not work?


  • Subject: Re: why does this not work?
  • From: Damien Bobillot <email@hidden>
  • Date: Thu, 2 Feb 2006 13:25:24 +0100

Nils Holland wrote :

Because the data type "bool" doesn't exist in C?

Why not make normal integers out of your booleans and then modifying your code accordingly (so, set these ints to 0 or 1 as you can't set 'em to TRUE or FALSE)?

I think that the bool type was added in C99. However, it doesn't seem to work automatically, one has to manually add :
#include <c.h>


--
Damien Bobillot

Robert Dell schrieb:
i'm converting one of my data structures to c from objective-c in order to use it in a web cgi program (new command-line tool).

the problem is having boolean values inside a structure, the compiler goes nuts.

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <pwd.h>
#include <string.h>
#include <time.h>

struct expskill
{
long skillvalue;
long skillreqs;
long skillNeeded; // WAS bool
long skillexclude; // WAS bool
char skillname[80];
bool whyDoesThisParameterNotWork;
} myarmor[8], myweapon[25], mymagic[5], mysurvival[15], mylore [13], myinstruments[5], swap;

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >why does this not work? (From: Robert Dell <email@hidden>)
 >Re: why does this not work? (From: Nils Holland <email@hidden>)

  • Prev by Date: Re: How to do multilanguage support
  • Next by Date: Re: why does this not work?
  • Previous by thread: Re: why does this not work?
  • Next by thread: Re: why does this not work?
  • Index(es):
    • Date
    • Thread