C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28651
Number of posts: 94667

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
bool array Posted by tubby on 6 May 2011 at 1:27 AM
Hello people,
I am using Turbo-C

Can anyone give me a sample program using the bool array

I tried compiling the following code snippet. But it doesnt work.

#include<stdio.h>
#include<conio.h>

int main()
{
bool a[10]={true};
clrscr();

printf("\nHello World");

getch();
}

It gives the error Undefined Symbol bool.

But something peculiar i noticed is that,
when i declare an int (or any other data type for that matter ), its highlighted in white, but bool is not highlighted.
Is it that my Turbo-C is not able to recognize bool ?

Please reply








Report
Re: bool array Posted by pseudocoder on 6 May 2011 at 10:14 AM
I don't think bool is a valid type in TC; if you're saving your source as .c, then you might try a typedef statement.

bool may be valid in c++ though... I can't recall. to check, try saving your source with a .cpp extension and use the standard cpp headers.

HTH
Report
Re: bool array Posted by andrewgail on 6 May 2011 at 12:04 PM
You need to store an array of true and false values in your C# program. We find that bool arrays are generally ideal for this purpose, as they are simple and acquiesce for safe and bright code.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.