MicroSoft Studio 2010 and This website

I just installed and started using Microsoft C++ 2010 Express and started the whole "Hello World!" Program. I start a whole new project and I'm looking at this website tutorial and the tutorial. The Coding setup looks different for this site and the one offered by Microsoft.


// MyFirstApplication.cpp : Defines the entry point for the console application.//

#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
Module Module1

Sub Main()
Console.WriteLine("Hello, world!")
End Sub

End Module
return 0;
}

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}


Since the tutorial in Microsoft says
#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
Module Module1

Sub Main()
Console.WriteLine("Hello, world!")
End Sub

End Module

Instead of-

int main ()
{
cout << "Hello World! ";
return 0;
}


Will this affect MicroSoft Visual's ability to run this site "Hello World!" coding? If so is there a suggested website that I can download C++ that incorporates this sites method of coding instead of Microsoft's? Or does it not matter? I ask this because I like this site method better and find it easier and faster to type out.

I typed out both codes in and got "The system could not find the path specified."
Last edited on
This looks a lot like some .NET shenanigans, which I would avoid if you are just learning. Stick the actual language, not Microsoft's weird stuff
I just realized I didn't actually answer anything, I apologize. If you are using Visual Studio, when you create a new project, just click "Empty Project", and make sure pre-compiled headers are not turned on.
Thanks I'll try that and Thank You for replying so quickly.
Should work fine for ya, if you have any more issues feel free to ask away
That appears to be a Visual Basic module, though Ive never seen it wrapped in a main function.
Ok it seems to work but the system keeps saying "The system cannot find the path specified. "
Also I forgot to add the site offered by MicroSoft Visual
http://msdn.microsoft.com/library/bb330924.aspx
I suggest just creating a new, empty project (pick "Empty Project") and writing the C++ hello world code from this site into an empty cpp file you create.
I have selected "empty project", but the same error comes up.
Last edited on
When is that error occurring? When you try to compile? Or link? Or run?
Ah yea that is a visual basic link, are you intending to learn visual basic, or are you trying to learn C++?
It occurs when I go to "Debug". I choose "Start Without Debugging". I click "NO" when it ask if I would like to "Build".
Then the error message pops up.

I'm trying to learn C++.
Well, scratch the code that you posted, and stick to C++ tutorials. The ones on this site are pretty decent.

You want to build whenever you run after making changes. Building compiles your program, if you don't build then you won't have anything
I feel so stupid for wasting all of your time it works now that it was built. So sorry -.- but Thank You for the help :D
Hey no worries. I remember starting out and being completely lost over, what is now, trivial things to me
Thanks I hate to admit it but since the colors on the tutorial was purple and mine was red I freaked out a little thinking I messed up.
Topic archived. No new replies allowed.