Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Boolean as elements in Array?

Status
Not open for further replies.

pete

Member level 2
Joined
Aug 21, 2005
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,785
Hi to all! Is this possible? I need either 1 or 0 as elements in array.
 

philba

Full Member level 2
Joined
Jan 26, 2006
Messages
132
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,298
Activity points
3,102
in what language? c? of course.

however, you don't say how you want to use it so there is no way to know what you really need.
 

Tohu

Full Member level 1
Joined
Jun 9, 2004
Messages
96
Helped
16
Reputation
32
Reaction score
4
Trophy points
1,288
Activity points
1,328
Hi, i think this is depend not only from the language, but also from compiler and procesor. For example, in Keil for x51 you can't do this, you cant make the area of bool, and cant put bool in structure or unit. Actually have the way to made area of bool, but can put it to the structure or unit. The reason, if i undersoot right is that or bit variable they use not a memory and on a registry.
 

philba

Full Member level 2
Joined
Jan 26, 2006
Messages
132
Helped
13
Reputation
26
Reaction score
1
Trophy points
1,298
Activity points
3,102
yes, that is true but he didn't say what size he wanted the element to be (or what language or what processor). if it's one bit then it is totally dependent on the compiler (and language and processor).
 

pete

Member level 2
Joined
Aug 21, 2005
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,785
Sorry, i mean CCSC compiler and using a PIC. If an array could handle other number types, why can't it handle 1 and 0 as array elements?
 

Tohu

Full Member level 1
Joined
Jun 9, 2004
Messages
96
Helped
16
Reputation
32
Reaction score
4
Trophy points
1,288
Activity points
1,328
No, in CCS area of bit is not permit, but i memory that in a several project using the bit area ...... i not suare how exactly ... will be check later.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top