Welcome to TRiBot Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


  • Content count

  • Joined

  • Last visited

  • Feedback


Community Reputation

0 Neutral

About Kappa

  • Rank
    New Botter
  1. Look at the C++ one, even worse.
  2. I noticed that this section of the forum is completely dead so I thought that I would post a Hello World tutorial, as that is always where newbies start. The images included may be large but I thought it would be better to have them absolutely clear than hard to make out. I am using Visual Studio 2012. Download and install Visual Studio 2012 or Visual C++ Express Edition from the Microsoft website. Now, create a new C++ project. A window will pop up, press next on it and it should bring you to this page: Select the "Empty Project" box and press Finish. This will create the project without any source or headers in it at all. Now, Head to the Solution Explorer. Right click on Source Files > Add > New Item > C++ file. Call this new file "Main.cpp". Now to begin writing code; there is not a lot of it. The first thing we need to do is include something called a library which will allow us to get input and output from the console. We do this by typing: #include <iostream>where iostream is the name of the library. Under that, write: using namespace std;I will explain what this does in a minute. The ; at the end means that it is the end of a statement and this semi colon is found at the end of most lines in C++, take note of this. Now to write the main method. This is what your program will execute when it first starts up. int main(){ return 0;}int means that this method will return an integer value, also known as a whole number. By 'return' I mean that this is what the method "gives back" once it is finished running. I will explain this in a later tutorial. What you need to know for now is that when the main function reaches the end, it returns 0 which tells us that it ran successfully. Inside the main method, we can write to the console window. To do this, insert the following lines inside the braces ( the { } marks ). cout << "Hello world!" << endl;Cout means console output. We pass in something called a string value, which is really just a piece of text. A string is always encased by quotation marks. Endl simply means that it is the end of the line, so the next time we call cout, it will be written on a new line. Remember the std namespace that we defined before? If we didn't use that we would have to write std::cout, so we include the std namespace simply to make it more convenient. After this line, write: cin.get();Cin stands for console input. This line reads input from the console but doesn't do anything with it. It will stay on this line waiting for you to press the enter key before it will proceed. If we didn't have this line, the window would flash up and vanish after executing. Here is an finished, commented, code incase you have any difficulties: #include <iostream> //Includes the library needed for console input and output.using namespace std; //Used so that we don't have to type std::cout, just cout.int main() //This is the main method. When the program starts, this will be ran. { cout << "Hello World!" << endl; //Prints "Hello world!" to the console window. The endl simply ends the line. cin.get(); //Gets input from the console, in this case it is used to simply wait for the user to press a key. return 0; //Tells us that the program ran successfully.}Now click the debug icon at the top, it looks like a play button. This will compile your code and run it.
  3. I already knew C# by the time I looked at Java, and luckily they are both very similar so there was no problem. I learned by reading what other people had written and working out how to make my own things by using similar techniques as them, if you get what I mean. Anyway, it does get easier over time and there is a very good teacher on youtube called Thenewboston who has a variety of tutorials regarding many different languages including Java.