typ bool im Winavr

Gast #320626
Lesenswert?

ja das hab ich schon aber das find ich ist eine unsaubere lösung...
ich habe einen unsigned char draus gemacht das meinst du doch ?

Außerdem funktioniert s16 u08 auch nicht mehr ... aus s16 habe ich int
und aus u08 unsigned char müsste ja trotzdem funktionieren oder ?

kann ich die alten typen nicht wieder anlegen oder so ?
Gast #320633
Lesenswert?

Eric Weddington schreibt:

Everyone should just drop using #define'd TRUE and FALSE.

The C99 standard introduces a new header file: #include <stdbool.h>.
You now have the type bool, with enum values of true and false. There
is no need to define your own values now. You can use them as such:
Code:

#include <stdbool.h>
//...
bool foo(void)
{
   bool success;

   success = true;
   if (success)
   {
      // do something
   }

   success = false;
   return (success);
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren