Im new, need overview

Hey, ive just joined the network, i stated using visual studio 6 c++ , and began learning the basics like the beginners hello world console application and learning basic structure on coding. then my firend told me to scrap VS6c++ and use the Visual Studio c++ express 2005, and the compiler doesnt understand c++ coding, so i type in the basics to just recap,

//blah blah
#include <iostream.h>

int main() {

  //blah blah
  cout << "Hello, World!" << endl;

  return 0;

}

typing this in doesnt work, its now as so

#include "stdafx.h"

 

int _tmain(int argc, _TCHAR* argv[])

{

char source[] = "Hello world!";

char destination[20] = { 0 };

return 0;

}

since im new to this, can anyone give me links to visual studio express c++ 2005 tutorials, or can you help me,




Answer this question

Im new, need overview

  • DingW

    can i still write in normal c++ code in VE2005

  • ImpureEvil

    Assuming you have created a C++ Win32 Console Application then the following would work:

    #include <stdafx.h>   // Just try to pretend that this line isn't here
    #include <iostream>   // iostream.h is no longer supported

    int main()
    {
       std::cout << "Hello World" << std::endl;
    }


    It is unfortunate that the project system requires stdafx.h but the alternative, working out how to disable pre-compiled headers appears to be difficult to find/explain, so I have decided that the easiest solution is just to leave it there.

    The old iostream header file, iostream.h, is no longer supported: you need to use the C++ Standard version, iostream, one side effect of this change is that the contents of the header file are now, correctly, in the std namespace.

  • vitty

    oh i see, thanks alot. if i get any other problems ill possibly end up posting back here, do you use visual studio express 2005
    Btw is

       std::cout << "Hello World" << std::endl;

    like the new way of saying

       cout << "Hello World << ; endl
    you just include the std:: bits


  • intelligentidiot

    oh ok thanks alot

  • FrankEvans

    I use many different versions of Visual C++ 2005 : currently I am using the Team Server Edition (Developer).

    Yes: the two are equivalent:

    You can also do:

    #include <iostream>

    using namespace std;

    int main()
    {
       cout << "Hello World" << endl;
    }






  • Bill52

    That's a pity: the C++ language that Visual C++ 6.0 is really antiquated with respect to the C++ Standard: if you want to learn and use "official" C++ then Visual C++ 2005 is a much better choice.

    Don't worry about the new syntax we have added to support C++/CLI you don't need to use it write Standard C++ programs.

  • Amol Gholap

    There's nothing non-standard, or magic/special, about #include <stdafx.h> it is mostly used by the pre-compiled header file system: though it can also be used as a stand-alone header file. If your project is not using pre-compiled headers and is not using anything Windows specific then you can do without #include <stdafx.h>.

  • hbcondo

    Yes: you definitely can. Visual C++ 2005 continues to fully support ISO Standard C++.

  • Matt_Garven

    ye Im gonna probly use VBC++6 again, the new express 2005 c++ is to annoying to use, its pretty much as new langue

  • timay

    But one thing, instead of typing #include <iostream> i just type #include <stdafx.h>

  • Im new, need overview