Thread: Dev-C++

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    25

    Exclamation Dev-C++

    I am following the instructions provided by this home website http://www.cprogramming.com/tutorial.html#c++tutorial
    but i'm having trouble compiling it.
    What am i doing wrong?
    Code:
    #include <ionstream>
    using namespace std;
    int main()
    {    
        cout<<"This is a test Program!\n";
        cin.get();
        
        return 1;
    }
    \Programs\Programing\Programs\Untitled1.cpp E:\Programs\Programing\Programs\E ionstream: No such file or directory.
    E:\Programs\Programing\Programs\Untitled1.cpp In function `int main()':
    5 E:\Programs\Programing\Programs\Untitled1.cpp `cout' undeclared (first use this function)
    (Each undeclared identifier is reported only once for each function it appears in.) 6 E:\Programs\Programing\Programs\Untitled1.cpp `cin' undeclared (first use this function)

    and could someone please explain to my what in the world ionstream is and whatthe point of #include <ionstream>?

    Thanks

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,412
    You have a typo error: it should be iostream, not ionstream (this has to do with Input/Output, not ions).

    Also, change the return 1 to return 0 (or remove it entirely as it is optional in C++ for the main function).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jun 2008
    Posts
    25
    I also tried copy pasting it but it still won't compile, what do i do?

  4. #4
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    It should be <iostream> (no 'n'), and the point is so you can use standard I/O streams like cout and cin.

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Ion Stream sounds like a cool company name, though...

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    25
    THANKS ALOT, i feel so dumb now, but still, what is iostream?

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,412
    A standard header that is included "so you can use standard I/O streams like cout and cin".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Input/output streams such as cin, cout. Read data from keyboard/output to screen and the like.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User
    Join Date
    Apr 2008
    Posts
    890

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Whats better, C-Free or Dev C++??
    By i_can_do_this in forum Tech Board
    Replies: 10
    Last Post: 07-07-2006, 04:34 AM
  2. New to Dev C++/<windows.h>...
    By Cilius in forum C++ Programming
    Replies: 3
    Last Post: 02-23-2005, 01:05 AM
  3. Glut and Dev C++, Programs not Quitting?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-29-2004, 08:43 PM
  4. DEV C++ Limitations?
    By Kirdra in forum Game Programming
    Replies: 3
    Last Post: 09-09-2002, 09:40 PM
  5. Tutorial about Bloodshed Dev!
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 11-13-2001, 07:42 PM