Sign in to follow this  
xxrobustchumxx

starting off

Recommended Posts

jyk    2094
Quote:
Original post by xxrobustchumxx
Im not starting off right or something can i get soem help on this with the hello world thing i just dont know whats going on
Tell us what language you're programming in, and post the code for your 'Hello World' program along with any compiler errors or other relevant information. Or, if you haven't gotten that far yet, explain what it is that you're confused about.

Share this post


Link to post
Share on other sites
Herbal    100
Hello World -- C++
(Anything following '//' is a comment)

#include <iostream> //This is the standard header file for C++ input and output
using namespace std; //Uses standard namespace. Makes life simpler.
int main() //Main block of code
{ //Start of code
cout << "Hello World\n"; //Print 'Hello World'. \n means newline.
return 0;
} //End of Code

Share this post


Link to post
Share on other sites
Fukushuusha    186
Since you seem to be very new to this whole thing first a warm welcome is in order :)

So ... welcome !

After the welcome , I would suggest starting off by reading this which the site's staff has written exactly for beginners.Just check each section of that beginner's FAQ to see the answers to all your questions.

As for what is hello world , it is a program which in any language prints the String "Hello World" as output.It is a tradition to begin learning any language by doing a Hello World program ;)

Share this post


Link to post
Share on other sites
Simian Man    1022
There is a lot to understand in C++ Hello World. I mean include directives, namespaces, functions, objects, and operators are all present! In a way, you have to just accept some things so you can learn about others. What exactly are you having trouble with?

Share this post


Link to post
Share on other sites
Jettoz    288

#include <iostream> //This is the standard header file for C++ input and output
using namespace std; //Uses standard namespace. Makes life simpler.
int main() //Main block of code
{ //Start of code
cout << "Hello World\n"; //Print 'Hello World'. \n means newline.
return 0;
}



Every C/C++/C# program has a Main() Function, this Main() is where your program will always start first at.

When you write code in C++ you use "{ }"
{ = Begin the Code
} = End the Code

cout = Just to print to the console screen.

So if you wanted to add "Hello C++!!" You could just do this:


#include <iostream> //This is the standard header file for C++ input and output
using namespace std; //Uses standard namespace. Makes life simpler.
int main() //Main block of code
{ //Start of code
cout << "Hello World\n"; //Print 'Hello World'. \n means newline.
cout << "Hello C++!";
return 0;
}



Just to sum up the "{ }"

{ // Start Code
CODE GOES HERE
} // End Code

Hope this helps.

Check out http://www.cplusplus.com/doc/tutorial/ for more help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this