bool array - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

bool array

tubbytubby Posts: 7Member
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
#include

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

printf("
Hello World");

getch();
}

It gives the error [b]Undefined Symbol bool[/b].

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








Comments

  • pseudocoderpseudocoder Posts: 687Member ✭✭✭
    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
  • andrewgailandrewgail Posts: 1Member
    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.
Sign In or Register to comment.