What's new

[Tutorial] Learning about C++ (Beginners)

T

toofaces2

PS3 Developer
Messages
1,148
Reaction score
560
Basics of C ++ and compiler

Learn C ++ programming is an option that is also still perceived by programming beginners.
Often one starts today with Java or C # as the first programming language.
But C ++ to learn still makes sense, since some concepts are included, which does not exist in Java and C #.
Although these concepts have lead to a higher error rate of C ++ - programs that give the programmer as well as greater control and allow more efficient and faster programs.
This C ++ - tutorial will give you a information and general overview of the language and to introduce some of the core elements of the language.
To learn properly then C ++ program.

C ++ learn programming - basics of the language

C ++ is a both imperative and object-oriented programming. Object orientation means (roughly speaking) that you try to model a program like in the "real" world with the help of objects that interact with each other. Imperatives programming means that you give the computer a set of instructions that specify the order in which that is done.

In contrast to "modern" programming languages like Java and C # exist in C ++ some concepts like manual memory management and pointer arithmetic, which are considered complex and error-prone. Therefore, it is probably especially for beginners often easier to first learn the basics of programming based on these other languages and then later go into C ++ with these complex concepts. Nevertheless, it is also still recommended to start directly with C ++, if you want to have a complete overview of elemantare components of programming immediately. It also allows C ++ to program more efficient programs, since the programmer has more control than in other programming languages.

The language C ++ is basically and theoretically platform independent. In practice, however, it is so that the functionality of C ++ is supplied largely by external libraries and these libraries are then but sometimes depending on the platform. As a rule, you can assume that you can not translate so readily on a Linux system is a program that you have programmed for Windows.

The advantage of this is again that you can program much closer system in
C ++ and so has access to specific system functions that remain hidden in an other programming.

Compiler and development environment

There are a ton of C ++ - Compiling and development environments that you can use if you want to learn programming. Known representatives freely available under the compilers have the
Borland compiler and the GNU compiler (under Windows, however a port as required MinGW). Simple but it is already at the start, if you are using an integrated development environment for programming. Here, there are paid tools, but also some free alternatives. In particular, Microsoft put a free Express version of its Visual Studio development environment available. Another free development environment for programming with C ++ is NetBeans.


The Obligatory "Hello,World"
In all its glory, the following code is the simplest C++ program you’re likely to encounter.​
C:
// helloworld.cpp
#include <iostream>
int main(int argc, char** argv)
{
std::cout << “Hello, World!” << std::endl;
return 0;
}
This code, as you might expect, prints the message Hello, World! on the screen. It is a simple program and unlikely to win any awards, but it does exhibit several important concepts about the format of a C++ program. Comments
The first line of the program is a comment, a message that exists for the programmer only and is ignored by the compiler. In C++, there are two ways to delineate a comment. In the preceding example, two slashes indicate that whatever follows on that line is a comment.
C:
// helloworld.cpp
The same behavior (this is to say, none) would be achieved by using a C-style comment, which is also valid in C++. C-style comments start with /* and end with */. In this fashion, C-style comments are capable of spanning multiple lines. The code below shows a C-style comment in action (or, more appropriately, inaction).
C:
/
* this is a multiline
* C-style comment. The
* compiler will ignore
* it.
*/
Preprocessor Directives

Building a C++ program is a three-step process. First, the code is run through a preprocessor, which recognizes metainformation about the code. Next, the code is compiled, or translated into machine-readable object files. Finally, the individual object files are linked together into a single application. Directives that are aimed at the preprocessor start with the # character, as in the line #include <iostream> in the previous example. In this case, an include directive tells the preprocessor to take everything from the iostream header file and make it available to the current file. The most common use of header files is to declare functions that will be defined elsewhere. Remember, a declaration tells the compiler how a function is called. A definition contains the actual code for the function. The iostream header declares the input and output mechanisms provided by C++. If the program did not include it, it would be unable to perform its only task of outputting text.

For more Information or Question Please feel free and PM me.
Credit: Nicholas A. SolterJohn Wiley & Sons(helloworld.cpp)
 
Last edited:
D

DeleteMe1744

Enthusiast
Messages
67
Reaction score
25
Let alone the ripping, the tutorial itself is inconsistent.

-You mention compilers and IDEs before explaining what a compiler is and what it does.
-You introduce people to the commenting syntax out of nowhere
-You then jump back to the building process and roughly explain what it involves.

And for some reason it ends here.

Also, here is another source you "forgot" to mention:
http://java-language.wikidot.com/blog:_start
 
E

Engineering

Banned
Messages
19
Reaction score
1
Thanks trying to get into this language
 
W

WildeThing

Enthusiast
Messages
212
Reaction score
63
I really angers me when:
1) You add in a space between 'C' and '++' (and 'C' and '#') etc.
2) You didn't use code=cpp BBCode.
3) I don't think "roughly speaking" is an appropriate thing to say about the object orientated paradigm.
4) You copied a 'tutorial' from 2005 (I think) that mentions how pointers are error prone. No, raw pointers are error prone if the programmer fails to use them correctly. #smartpointerspls
5) You.. you.. mentioned the Borland compiler.
6)
C:
/*
 * Your multiline comment should look like this, it needs to start with "/*" or else it will not work.
 *
*/
 
M

Modforfreedommind

Enthusiast
Messages
77
Reaction score
5
All of this interesting thing but it's a language of ALIEN for me i understand NOTHING just only for software but others at the moment it's impossible to understand for me
 
W

WildeThing

Enthusiast
Messages
212
Reaction score
63
All of this interesting thing but it's a language of ALIEN for me i understand NOTHING just only for software but others at the moment it's impossible to understand for me
That is the purpose of learning.. practising.. learning.. practising.. refining.. re-factoring.. learning.. learning.. learning.. forever.
 
M

Modforfreedommind

Enthusiast
Messages
77
Reaction score
5
That is the purpose of learning.. practising.. learning.. practising.. refining.. re-factoring.. learning.. learning.. learning.. forever.
All I would like to learn is getting SHA1 Hash then and the signature values and signatures digest
EDIT: If you know what i'm talking about (HTTP authentication)
 
W

WildeThing

Enthusiast
Messages
212
Reaction score
63
All I would like to learn is getting SHA1 Hash then and the signature values and signatures digest
EDIT: If you know what i'm talking about (HTTP authentication)
Define HTTP authentication. HTTPS authentication is over SSL which uses an encryption algo, not a hashing algo.
I assume you therefore mean like server side login authentication/validation.. don't use SHA1 for that.
 
Top Bottom