erros 2

This is a discussion on erros 2 within the C++ Programming forums, part of the General Programming Boards category; any advice for this? #include <iostream> #include <cmath> using namespace std; int main() { int i; cout << "Enter a ...

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

    erros 2

    any advice for this?

    #include <iostream>
    #include <cmath>
    using namespace std;

    int main()
    {
    int i;

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

    cout << "The number enters is less than or equal to 100:";
    }
    return 0;
    }

    errors:

    C:\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.exe - 4 error(s), 1 warning(s)

  2. #2
    ...
    ... is offline
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    as mentioned on another hauntingly similar thread:

    have you tried

    #include <iostream.h>

    yet?
    I came up with a cool phrase to put down here, but i forgot it...

  3. #3
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Change

    "if (i > 100)";

    to

    if (i > 100)

  4. #4
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    let's not forget

    Code:
    "if (i > 100)"; 
    { 
    cout << " The number entered is greater than 100:"; 
    
    cout << "The number enters is less than or equal to 100:"; 
    }
    to

    Code:
    "if (i > 100)"
      cout << " The number entered is greater than 100:"; 
    else
      cout << "The number enters is less than or equal to 100:";
    and, use code tags to help eachother out...
    hasafraggin shizigishin oppashigger...

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
    By prlove71 in forum C++ Programming
    Replies: 2
    Last Post: 03-13-2002, 05:04 PM

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