• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

A beginners guide to C++

Psycho_Coder

Active Poster
Retired Staff
Active Member
I was writing this last night, Any mistakes please correct. I did say this would be for beginners, but many might think that this guide comes a little advanced in the first couple of paragraphs. You take it slowly, Take the time you need to get it right.

Hello, Console Crunch and welcome to RealTimeModding's C++ Guide. Basically, C++ prorgramming is an object-oriented derivative of C. But, You already know if, You don't Go and learn, This guide is for people who have have a little bit of knowledge on this programming language.

C++ allows classes to define many different virtual functions, Somewhat You can do this with more than one definition of any function. This will most likely be resolved when you run your program for the very first time. You might not have heard of this work, but this is basically called "The Polymorphism". I will not go in-dept into what it means, You can always look on google, or ask a friend. Using different template classes also allow you to use the same class but with different types of data. Knowing that you will notice that your code will not change at all. I am going to start you all off buy using basic IOS ++. All this does is introduce the standard C++ libary. You now realise that if you are including the C++ libary, You will include the template libary.

Creating a program that does absolutely nothing!(iostream background++) Right, So look below. You will a bit of code.

Code:
Main(){}

Look at is correctly, Now, In every program you see coded in C++ will have That code. It must have one or more of these functions other your program will into function properly. If you turn it into a program right now, You will realise that it will do absolutely nothing. Obviouslythere are others way to do it.
Look at the below example.

Code:
#include <iostream>
int Main(){return 0;}

This code needs to be stored into a file called donowt.cpp. It must contain the .cpp file extension. Basically, You need this extension because it means that you writing a C++ program. If you look closely you will see that I wrote <iostream>, Basically, all that means is that it is a simple header file which contains useful declairation. This is used for compiling and execution program. You may now that iostream is an alternative but does not replace the actual C header file. Here is the correct way to write the file.

Code:
#include <iostream>
using namespace std;
int Main(){}


The name space has no effect at all really, as of yet, you have not really produced any code. although, It can become effective if you use a different code but meaning the same as namespace. Once, You are up to date with tis guide You can then start to look at this more advanced code.

Code:
#include <iostream>
using namespace std;

calss nodisp
{
private:
public:
void output()
{
     return;
}
}

int Main()
{

    nodisp screen;

    screen.output();
}

This is nothing important but this basically just declares the class nodisp. output is basically the only main function in the code.

I hope to carry this on more.
Thanks for your time Console Crunch.
 
Code:
#include <iostream>
using namespace std;

calss nodisp
{
private:
public:
void output()
{
     return;
}
}

int Main()
{

    nodisp screen;

    screen.output();
}

This is nothing important but this basically just declares the class nodisp. output is basically the only main function in the code.

I hope to carry this on more.
Thanks for your time Console Crunch.

i think ya got a spelling error and might cause code error in your code :p "calss"
 
General chit-chat
Help Users
  • No one is chatting at the moment.
      Chat Bot: fm88vietnamco is our newest member. Welcome!
      Back
      Top