Tuesday 15 July 2014

c - Alternative to this; STDBOOL not found -


I'm trying to read a key hit and then want to stop a code. In C

  #include & lt; Conio.h & gt; # Include & lt; Stdio.h & gt; # Include & lt; Stdlib.h & gt; # Include & lt; Stdbool.h & gt; Boole Start () {Four C; If (kbhit ()) {c = getch (); If (c == "s" || c == "s") {back true; } Other {return false; }} And {return false; }} Int main () {while (! Start) {printf ("line 1"); Delay (100); } Return 0; }   

without stdbool.h , it says such as

  syntax error: identifier 'start', syntax error: ", "Syntax Error:") "'Start': Undeclared Identifier   

With stdbool.h, it says that the file was not found. My compiler is one that comes with Visual Studio 2010.

Any suggestions on how to remove it? How can I still use a function that boolean values?

Added Sorry! Added for short comment. Most solved all thanks to

added more errors: after compilation: it reads:

  filename.obj Unsolved external symbol _delay function Referenced in _main.   

What should I do?

stdbool H to be presented in C99 , And does not support Visual Studio C99 . One possible way you can define your types is:

  typedef int bool; # Define the true # 1 define wrong 0    

No comments:

Post a Comment