I've been learning c++ using code blocks and I decided to try using visual c++ so I could eventually use directx sdk so in code block the hello world code I used was
I learned it on thenewboston.com and in code blocks it works fine I know that's the easiest code there is but i don't understand why it doesn't work in visual c++ express
I accidentally forgot the ; after namespace std om my post but still I have that in the code in code blocks and when I compile it I get hello world but when I copy the same code and paste it in visual c++ and compile it I get errors
Sorry about that also the forum made it capital but just trust me on it worked in code blocks but the same code I out in visual c++ doesn't I just dont understand why it wouldent.
"The forum made it capital"? Either you're using a very strange browser or... well, it doesn't need to be said.
In any case, copy & paste the error messages and make sure no mysterious alterations happen this time.
Visual C++ doesn't automatically keep the console from closing - Code::Blocks does. You'll have to incorporate your own anti-console-closing method.
The reason why it doesn't work as a Win32 application is because the entry-point is different from the conventional main(); typically, in Visual C++, it's _tWinMain(). You'll have to setup the project to a Win32 application. I should advise you that the code required to get a simple Win32 program up and running is far more challenging than that of a console.
Ok thank you also is thenewboston.com c++ tutorial a good way to start learning c++ or should I go ahead and use books. I'll continue learning c++ and eventually I'll figure this out.
TheNewBoston is a good source, but not that good. Put it this way, I wouldn't lean on his teachings too much. Read books if you can. Books go into more detail. The Lamborghini's of books are well structured, offer analogies, examples and are written by well known experts - even the creator himself - Bjarne.
I should mention 3 websites that are definitely reliable sources:
1) http://www.cplusplus.com
2) http://www.cprogramming.com
3) http://www.learncpp.com