#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Ohio
    Posts
    15
    Rep Power
    0

    Confused about MS VC++ .net


    Hi,
    I posted earlier about buying VC++ .net 2003 standard. Well I installed it last night, and typed in some code that works in my free dev-c++ compiler. the code is as follows:

    #include <iostream>
    int main()

    {
    std::cout << "Hello.\n";
    std::cout << "The product of 1250 and 8 is : " << 1250 * 8 << " ";
    return 0;
    }


    Now it compiles and works as intended with Dev-C++. Now, I copy and past the same code into VC++ .net 2003 and it fails, wont even build.

    To get it to work I had to change the header to <stdafx> I have no idea what it does, or why it works when i do that. I only tried putting it in my code becuase it was displayed under header files.


    What I want to know is why cant I use IOSTREAM headers in VC++?


    I asked someone I know, who has some knowledge in coding, and he said the program I bought (Visual C++ .net standard 2003) is a different language then regular c++ and that it focuses more on C# hence the .net. He said that the program I have is meant for web development...

    He recommended Visual Studio, which according to him comes with C++, BASIC, and Foxpro...

    I dont want to develop for the web, I want to make programs and learn regular C++...does any Microsoft compilers use just plain c++ ?




    Thanks for any help.

    Bohh
    Last edited by Bohh; September 3rd, 2003 at 03:30 PM.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Ohio
    Posts
    15
    Rep Power
    0
    Anyone?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0
    you program can compile and run ok in vc.net

    must create a windows consol program.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Ohio
    Posts
    15
    Rep Power
    0
    Yes, I did creat a win32 console program... what I wanted to know is why can't it use the iosteam header
  8. #5
  9. Cast down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    321
    Rep Power
    12
    You can use what you bought for "normal C++". It's actually a really good IDE too. Just go to file->new, win app, console app, empty project, then add a new .cpp file.
  10. #6
  11. SwollenMember
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Location
    the master control
    Posts
    264
    Rep Power
    15
    movEAX_444 is correct. it is a bit confusing at first, but if you follow his steps it will work. also might consider:


    using namespace std;

    instead of

    std::cout
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0
    just a empty project will work without stdafx.h.
    if not ,you would change the compiling command.

IMN logo majestic logo threadwatch logo seochat tools logo