Jump to content
  • Advertisement

GarciaBackhoff

Member
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

100 Neutral

About GarciaBackhoff

  • Rank
    Newbie
  1. GarciaBackhoff

    Guessing Game Problem

    WORKED! changed to codeblocks and changed extension. Thanks guys
  2. GarciaBackhoff

    Guessing Game Problem

    Ok changed everything you have stated, but it still marks something wrong with the <iostream>. //Guess my Number (inverted) //The computer will guess your number #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int myNumber; char yorn; cout <<"Enter a number between 1 and 10: "; cin >> myNumber; cout <<"\nYou chose "<<myNumber <<" as your number."; srand(time(0)); do { int theNumber = rand() % 10 + 1; cout <<"Is your number "<<theNumber<<"? (y/n)"; cin >> yorn; } while ((yorn != 'y') || (yorn !='Y')); cout <<"I won !"; return 0; } This is what it marks. C:\Users\Guillermo\Desktop\C++\Learning\test.c|4|error: iostream: No such file or directory| C:\Users\Guillermo\Desktop\C++\Learning\test.c|5|error: cstdlib: No such file or directory| C:\Users\Guillermo\Desktop\C++\Learning\test.c|6|error: ctime: No such file or directory| C:\Users\Guillermo\Desktop\C++\Learning\test.c|8|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'| C:\Users\Guillermo\Desktop\C++\Learning\test.c||In function 'main':| C:\Users\Guillermo\Desktop\C++\Learning\test.c|16|error: 'cout' undeclared (first use in this function)| C:\Users\Guillermo\Desktop\C++\Learning\test.c|16|error: (Each undeclared identifier is reported only once| C:\Users\Guillermo\Desktop\C++\Learning\test.c|16|error: for each function it appears in.)| C:\Users\Guillermo\Desktop\C++\Learning\test.c|17|error: 'cin' undeclared (first use in this function)| ||=== Build finished: 8 errors, 0 warnings ===|
  3. GarciaBackhoff

    Guessing Game Problem

    Still giving me problems, here is what I have changed. //Guess my Number (inverted) //The computer will guess your number #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { int myNumber; char yorn; cout <<"Enter a number between 1 and 10: "; cin >> myNumber; cout <<"\nYou chose "<<myNumber <<" as your number."; srand(time(0)); do { int theNumber = rand() % 10 + 1; cout <<"Is your number "<<theNumber<<"? (y/n)"; cin >> yorn; } while (yorn != y); cout <<"I won !"; return 0; }
  4. GarciaBackhoff

    Guessing Game Problem

    It displays a lot of messages, but I believe its this one... "iosteam: No such file or directory. "
  5. GarciaBackhoff

    Guessing Game Problem

    [color=#000000][font=verdana, arial, helvetica, sans-serif]Hello, I tried making a guess my number game, but inverted, by having the user input a number and the computer trying to guess it.[/font] [color=#000000][font=verdana, arial, helvetica, sans-serif]Here is the source code.[/font] //Guess my Number (inverted) //The computer will guess your number #include <iosteam> #include <cstdlib> #include <ctime> using namespace std; int main () { int myNumber,; char yorn; cout <<"Enter a number between 1 and 10: "; cin >> myNumber; cout <<"\nYou chose "<<myNumber <<" as your number." do { srand(time(0)); int theNumber = rand() % 10 + 1; cout <<"Is your number "<<theNumber<<"? (y/n)"; cin >> yorn; } while (yorn == y); cout <<"I won !"; return 0; } [color=#000000][font=verdana, arial, helvetica, sans-serif]DevC++ says there is a problem in this part.[/font] [color=#000000][font=verdana, arial, helvetica, sans-serif]cout <<"Enter a number between 1 and 10: ";[/font] Thanks
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!