Results 1 to 13 of 13

Thread: Please help me in C++ simple program

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Please help me in C++ simple program

    Code:
    #include<iostream>
    using namespace std;
    int main()
    {
    cout <<"sonia";
    return 0;
    }
    I want to run this simple C++ program. I am getting error Unable to unclude file 'iostream'.
    I have gone thru all the options:-
    1) Tools-->Directories-->Check Include Path
    & many more that i searched on internet.

    Please HELP ME!!!!!!

  2. #2
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,170

    Re: Please help me in C++ simple program

    What os/compiler are you using? Have you used ansi c++ header files before? Try
    Code:
    #include <iostream.h>
    if this works then the compiler you are using is not ansi c++ compliant.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    Re: Please help me in C++ simple program

    Did you try iostream.h ?
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Please help me in C++ simple program

    I have downloaded DEV C++. I try to write the simple programm
    Code:
    #include<iostream.h>
    int main()
    {
        cout<<"sonia";
        return 0;
    }
    It is running without any errors. But when I run it, OUTPUT screen doesn't come.

    I don;t understand there is no need of line
    Code:
    using namespace std;
    in DEV C++??? Code is different for compilers???
    Last edited by sonia.sardana; May 9th, 2014 at 02:09 AM.

  5. #5
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,170

    Re: Please help me in C++ simple program

    You are not using ansi c++ which is now the standard. You are using a version of c++ from prior to about 1998 before the ansi c++ standard was formalised. This code
    Code:
    #include<iostream.h>
    int main()
    {
        cout<<"sonia";
        return 0;
    }
    is not ansi c++ and would not compile using current compilers. I would strongly suggest you change your compiler to a more up-to-date one that conforms to ansi c++ standard. The current version is c++11. You are likely to come across these compatibility issues again using dev c++.

    What os are you using? For Windows I would suggest Visual c++ express which is free.

    From where are you learning c++? I would suggest you have a look at
    http://www.learncpp.com/
    http://www.cplusplus.com/doc/tutorial/
    http://www.tutorialspoint.com/cplusplus/index.htm
    Last edited by 2kaud; May 9th, 2014 at 06:54 AM.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Please help me in C++ simple program

    2Kaud very thanks for the reply!!! I will download Visual C++ express and will work on it!!! I am using Windows 7.

    I want to ask one more thing, to download Visual C++ express, I need to download the whole Visual Studio or just downloading Visual C++ express will work?

  7. #7
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,170

    Re: Please help me in C++ simple program

    This is the link to download the various versions of Visual Studio 2013. You need Visual Studio Express 2013 for Windows Desktop. Once installed, you will need to register but there is no charge.
    http://www.visualstudio.com/en-us/do...R_CC=200323803

    As far as I know there is now just Visual Studio which contains c++.

    Have fun!

    Note that for c++ questions there is a more active companion forum at
    http://forums.codeguru.com/forum.php
    (although you will need to register again).
    Last edited by 2kaud; May 9th, 2014 at 09:03 AM.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Please help me in C++ simple program

    I have click on Microsoft Visual Studio Express 2013 for windows desktop.
    After clicking I have two options,see in IMAGE ATTACHED. I have chosen the first one.

    After clicking the first option, Further two options are there:-
    1) Express 2013 for Windows Desktop
    2) Ultimate 2013

    I download the first one.


    When i started Installation, Set up Blocked.
    Message come :-
    This Version of visual studio requires a computer with a newer version of windows.

    But I have Already Windows 7 on my lapi, Then y set is asking for newer version??
    Attached Images Attached Images  

  9. #9
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,170

    Re: Please help me in C++ simple program

    When I installed it on my Windows 7 laptop, I used the 2nd option and downloaded the DVD ISO image which I then burnt to a DVD. I then used this DVD to install successfully under Windows 7. I haven't used the first option. Is your Windows 7 installation fully patched with SP1 and all the latest hotfixes? VS 2013 requires SP1 for Windows 7 to be installed before VS2013 can be installed.

    See installation requirements here http://www.visualstudio.com/en-us/pr...dio-express-vs
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Please help me in C++ simple program

    Thanks for the reply!!! On clicking the 2nd option, Further two options are there:-
    1)Express 2013 for windows desktop
    2) Ultimate 2013
    WHICH OPTION TO CHOOSE?

  11. #11
    Frenzied Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    1,170

    Re: Please help me in C++ simple program

    Only option 1 - Express 2013 for windows desktop is free!
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Please help me in C++ simple program

    O my God, Express 2013 is 790 MB uff!!!!!!!!!!

  13. #13
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,598

    Re: Please help me in C++ simple program

    Which is why it requires a DVD. If it was 700 MB or less it would have fit on a CD.
    Of course, you could look at like... Wow, I get 790 MB of programming tools, and compilers and all for Free.
    Aren't you glad you didn't have to see how large Ultimate 2013 was.
    Last edited by passel; May 15th, 2014 at 02:11 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width