Some other errors for u :)

This is a discussion on Some other errors for u :) within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> #include <conio.h> int main() { int number; std::cout << "Please enter a number:"; std::cin >> number; std::cout ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    13

    Some other errors for u :)

    Code:
    #include <iostream>
    #include <conio.h>
    
    int main()
    {
      int number;
      std::cout << "Please enter a number:";
      std::cin >> number;
      std::cout << "You entered: " << number << endl;
      std::cout << "Press any key to exit";
      getch();
      return 0;
    }
    ok what i need to write for getch , not std , but what ? (if i want to remove the .h)

    and << endl; gives me an error .. dunno why , it says 'operator <<' is ambiguous

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    Don't remove the .h. <conio.h> is non-standard for getch().

    Use std::endl; (Just like you did for std::cin and std::cout).

    -Skipper
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    13
    ok so only iostream got that special fct.
    thx m8

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  2. Unknown Errors in simple program
    By neandrake in forum C++ Programming
    Replies: 16
    Last Post: 04-06-2004, 02:57 PM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 04:44 PM
  4. Help me with these errors... :-(
    By major_small in forum C++ Programming
    Replies: 6
    Last Post: 09-07-2003, 08:18 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21