Hi
what data type is fast ?
-bool
-char
if u know please reply me.
MAP
what data type is fast ?
Moderator: Board moderators
-
- Experienced poster
- Posts: 120
- Joined: Sat Nov 01, 2003 6:16 am
- Location: Dhaka (EWU)
-
- Guru
- Posts: 647
- Joined: Wed Jun 26, 2002 10:12 pm
- Location: Hong Kong and New York City
- Contact:
They both use up one byte.. and there isn't really a bool in pure C..
Check out http://www.algorithmist.com !
AFAIK the latest C standard defines two things:
1. bool data type (for which you need the stdbool.h header)
2. _Bool in case you don't want the former breaking legacy code,
this one being a macro with the added advantage that it can #undef-ed.
I will need to look up the size of the former though, but most likely as with others it must be left to the implementors.
Regards,
Suman.
1. bool data type (for which you need the stdbool.h header)
2. _Bool in case you don't want the former breaking legacy code,
this one being a macro with the added advantage that it can #undef-ed.
I will need to look up the size of the former though, but most likely as with others it must be left to the implementors.
Regards,
Suman.
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
Code: Select all
joachim@joabox[bool]$ gcc -dumpversion
3.3.4
joachim@joabox[bool]$ cat testbool.c
#include <stdio.h>
#include <stdbool.h>
int main(){
printf("%d\n",sizeof(bool));
return 0;
}
joachim@joabox[bool]$ gcc testbool.c
joachim@joabox[bool]$ a.out
1
joachim@joabox[bool]$
-
- Experienced poster
- Posts: 120
- Joined: Sat Nov 01, 2003 6:16 am
- Location: Dhaka (EWU)