Check alle échte Black Friday-deals Ook zo moe van nepaanbiedingen? Wij laten alleen échte deals zien

[Highlighter] Binaire getallen in de C/C++ highlighter

Pagina: 1
Acties:
  • 45 views sinds 30-01-2008

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

Topicstarter
Jaja, daar ben ik weer. :P

Verwijderd in "Hulp C programmeren ATMEGA"
0b0010 is in vele (embedded) compilers gewoon syntactisch in orde, dus ik zou het wel handig vinden als die notatie gewoon ondersteund wordt, ook al is het AFAIK niet opgenomen in de ANSI-standaard. :)
C:
1
2
3
4
int a, b;
a = 0xEF;
b = 0b11111111;
return a & b;

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • crisp
  • Registratie: Februari 2000
  • Nu online

crisp

Devver

Pixelated

enkel 0b of ook 0B?
mag er een postfix achter staan? (u, l, ul, lu)?
mag er een + of - voor staan?

Intentionally left blank


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

Topicstarter
0b vs. 0B mag geloof ik wel, maar dat zou ik moeten nakijken. Postfixes en signs moet ik even checken op mijn laptop, daar kom ik nog even op terug. :) Ik gok overigens dat de regeltjes verder hetzelfde zijn als bij hexwaarden, dus als -0xAAul mag, dan mag -0b10101010ul ook. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • crisp
  • Registratie: Februari 2000
  • Nu online

crisp

Devver

Pixelated

lokaal done :)

Intentionally left blank


Dit topic is gesloten.