O_o cin and cout aren't declared?

This is a discussion on O_o cin and cout aren't declared? within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> int main() { int aArray[12]; cin >> aArray [4]; cout << aArray [4]; return 0; } Sorry ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    10

    O_o cin and cout aren't declared?

    Code:
    #include <iostream>
    
    
    int main()
    {
        int aArray[12];
        
        cin >> aArray [4];
        
        cout << aArray [4];
        
        return 0;
    }
    Sorry if this is some really simple mistake, but I am just starting, (suppose it's obvious with the simplicity, but it was just to try it and see if I could get it to work,) but I thought iostream declared cin and cout?

    Any help is really appreciated. Thanks.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    std::cin, std::cout.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    10
    ?

    Never had to use std:: before. They've always worked straight away like that.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,778
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >Never had to use std:: before. They've always worked straight away like that.
    You're probably used to a pre-standard compiler. The C++ standard introduced namespaces and placed every name in the standard library within the std namespace. Qualification is required on every compiler that claims to be standard.
    My best code is written with the delete key.

  6. #6
    Registered User
    Join Date
    Jul 2006
    Posts
    10
    Guess it makes sense. I hadn't used dev-c++ since I updated it.

  7. #7
    Registered User
    Join Date
    Jul 2006
    Posts
    10
    Thanks again

    (Sorry for the double post)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary I/O with cin and cout
    By The Urchin in forum C++ Programming
    Replies: 4
    Last Post: 10-24-2006, 12:47 PM
  2. Overriding Cin with Cout
    By Tainted in forum C++ Programming
    Replies: 5
    Last Post: 10-06-2005, 02:57 PM
  3. I'm REALLY confused. Why isn't cout or cin working here?
    By niudago in forum C++ Programming
    Replies: 8
    Last Post: 02-15-2003, 04:53 PM
  4. cin and cout
    By quentin in forum C++ Programming
    Replies: 6
    Last Post: 04-27-2002, 02:04 PM
  5. i don't know about cin, cout, flag.
    By comwin in forum C++ Programming
    Replies: 2
    Last Post: 11-08-2001, 03:26 AM

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