erros

This is a discussion on erros within the C++ Programming forums, part of the General Programming Boards category; Can anyone help me to figure out this problems? Include is the program and the erros. #include <iostream> int main() ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    4

    erros

    Can anyone help me to figure out this problems? Include is the program and the erros.

    #include <iostream>

    int main()
    {
    int i;

    cout <<"Enter a number:";
    cin >> i;
    "if (i > 100)";
    {
    cout <<"The number entered is greater than 100.";
    }

    return 0;
    }

    :\windows\desktop\ex3.cpp(7) : error C2065: 'cout' : undeclared identifier
    c:\windows\desktop\ex3.cpp(7) : error C2297: '<<' : illegal, right operand has type 'char [16]'
    c:\windows\desktop\ex3.cpp(8) : error C2065: 'cin' : undeclared identifier
    c:\windows\desktop\ex3.cpp(8) : warning C4552: '>>' : operator has no effect; expected operator with side-effect
    c:\windows\desktop\ex3.cpp(11) : error C2297: '<<' : illegal, right operand has type 'char [40]'
    Error executing cl.exe.

    ex3.obj - 4 error(s), 1 warning(s)

  2. #2
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    try " #include <iostream.h> " instead (without the quotes)

    its either that, or i guess you dont have the iostream library.
    I came up with a cool phrase to put down here, but i forgot it...

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    if you wish to use #include <iostream> without the .h
    probably the easiest way is
    using namespace std;
    refer to http://www.cprogramming.com/cboard/s...sing+namespace

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Lib erros when trying to compile C(++) in Kdevelop
    By Maragato in forum Tech Board
    Replies: 1
    Last Post: 07-29-2005, 04:01 PM
  2. qUEstion about erros on compiling
    By cogeek in forum C Programming
    Replies: 9
    Last Post: 07-30-2004, 02:27 PM
  3. Erros in Utility Header File
    By silk.odyssey in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2003, 06:17 AM
  4. erros
    By xlordt in forum C Programming
    Replies: 13
    Last Post: 04-13-2002, 09:43 AM
  5. erros 2
    By prlove71 in forum C++ Programming
    Replies: 3
    Last Post: 03-13-2002, 05:36 PM

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