error ahh

This is a discussion on error ahh within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> typedef unsigned short int USHORTINT; int main() { using std::cout; USHORTINT Width = 5; USHORTINT Length = ...

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    4

    error ahh

    Code:
    #include <iostream>
    
    typedef unsigned short int USHORTINT;
    
    int main()
    {
        using std::cout;
        
        USHORTINT Width = 5;
        USHORTINT Length = 5;
        USHORTINT AREA = Width * Length;
        cout << "Width: " << Width << "\n"; 
        cout << "Length: " << Length << "\n"; 
        cout << "Area: " << Area << "\n"; 
         int x; 
         std::cin >> x; 
         return 0;
     }
    error: --------------------Configuration: asdasd - Win32 Debug--------------------
    Compiling...
    adasdaasd.cpp
    c:\program files\microsoft visual studio\myprojects\asdasd\adasdaasd.cpp(14) : error C2065: 'Area' : undeclared identifier
    Error executing cl.exe.

    asdasd.exe - 1 error(s), 0 warning(s)


    I dont know whats wrong.. :/

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    AREA and Area are different in C++.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    4
    oh man i just saw that, thanks

  4. #4
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Location
    Mt. Prospect, IL
    Posts
    2,572
    1337, just like your name

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

Popular pages Recent additions subscribe to a feed

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