starting off

Started by
5 comments, last by Jettoz 17 years, 4 months ago
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
Advertisement
Which hello world thing? Which programming language are you using? Are you trying to follow a tutorial?
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.
Hello World -- C++
(Anything following '//' is a comment)

#include <iostream> //This is the standard header file for C++ input and outputusing namespace std;              //Uses standard namespace. Makes life simpler.int main()                                                  //Main block of code{                                                                //Start of codecout << "Hello World\n";                 //Print 'Hello World'. \n means newline.return 0;}                                                                   //End of Code
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 ;)
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?
#include <iostream> //This is the standard header file for C++ input and outputusing namespace std;              //Uses standard namespace. Makes life simpler.int main()                                                  //Main block of code{                                                                //Start of codecout << "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 outputusing namespace std;              //Uses standard namespace. Makes life simpler.int main()                                                  //Main block of code{                                                                //Start of codecout << "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.
____________________VB/C++/C# Programmer

This topic is closed to new replies.

Advertisement