The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 BOOL vs. bool

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
MBIMO Posted - 08/16/2005 : 11:09:20 AM
Origin Version (Select Help-->About Origin): 7.0552 SR4
Operating System: Win2k

Hello everybody,

I'm sorry to bother you people with a stupid question,
but what's the difference between the two data types BOOL and bool?

If I define two functions:

void Func1(BOOL aBoolean)
{}

void Func2(bool aBoolean)
{}

and call them in another function e.g.:

void Test()
{
Func1(TRUE);
Func2(true); // <==ERROR
}

I get the following error in the marked line when compiling:

Error, Function Func2@_BA was called, but its body could not be located during linking.
Linking Failed!

Does anybody know why the second line isn't working?


Thanks in advance,

Martin
2   L A T E S T    R E P L I E S    (Newest First)
MBIMO Posted - 08/17/2005 : 02:55:16 AM
Hi CP,

thanks for you help.

You are right, meanwhile I managed to run the example on a computer with an Origin 7.5 installation without any problems.

Thanks again,

Martin
cpyang Posted - 08/16/2005 : 12:16:57 PM
Maybe there was a bug in 7.0, but 7.5 should not have problem.

BOOL is typedef as int, and bool is internally char type. Reason for the two was for calling external DLL function which might have the two types. If all codes are inside OC, we usually just use bool.

CP



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000