text: Could someone give me an example of one or a link to one.
  I'm supposed to write one for class and can't find an example in the book.
  Thanks much-
  Could someone give me an example of one or a link to one.
  I'm supposed to write one for class and can't find an example in the book.
  Thanks much-
  Code:bool test(int x) { if(x) return true; return false; }
  i seem to have GCC 3.3.4
  But how do i start it?
  I dont have a menu for it or anything.
  Here's another one:
  Code:#include <iostream> using namespace std; bool canRide(int num) { if(num < 48) return false; else return true; } int main() { int input = 0; cout<<"Enter your height in inches: "; cin>>input; if(canRide(input)) cout<<"Please proceed through the gates\n" <<"and enjoy the roller coaster."<<endl; else cout<<"For safety reasons, you are not allowed\n" <<"on this roller coaster. Sorry."<<endl; return 0; }
  A true bool function:
  Code:bool Bool(bool Bool) { return Bool; }
  MagosX.com
  Give a man a fish and you feed him for a day.
  Teach a man to fish and you feed him for a lifetime.
  Last edited by The Brain; 04-22-2005 at 09:14 for the input.
  How's this? I'm supposed to determine if I am at the end of a sentence. If '.' or '?' or '!', return true, else return false.
  Code:bool IsEndOfSentence(char MyChar){ while(MyChar >> MyFile){ switch(MyChar){ case '.': return true; break; case '?': return true; break; case '!': return true; break; default: return false; } } }
  You should tell your instructor that you have no idea how to write a "bool" function, so you wrote a "predicate" instead.
  The crows maintain that a single crow could destroy the heavens. Doubtless this is so. But it proves nothing against the heavens, for the heavens signify simply: the impossibility of crows.
  I don't know how the rest of your program works, but I find that while loop to be suspect.
  .
  > while(MyChar >> MyFile){
  This part should be outside the function. This should be in main(), or whatever function calls this function.
  yes, IsEndOfSentence accepts a single char and should check if that chars is '.', '!' or '?' . The Brain's example above should give you a good idea.
  To sum it all up, get rid of the while loop and it should work.
  Also, you don't need the breaks in that example, because before it can reach any of the breaks it is returning from the function.
  nerds unite!
  I'm using windows XP.
  I'm using dev-C++ by bloodshed.