C++
The Ultimate Guide to Master C Programming Fast (c plus plus, C++ for beginners, programming computer, how to program)
ROBERT HOFFMAN
CONTENTS
I think next books will also be interesting for you:
C++
Python
Javascript
Hacking for Dummies
Computer Hacking
SQL
Introduction
Many of the applications of C++ involve more complex organizations of software pieces, including graphics and scientific computations. This is not to say that Java or other languages lack the ability to tackle these kinds of problems. C++ does have a history in these fields, with its ancestor being the C programming language. The best way to view it is that C++ added some object-oriented principles (OOP) to the C language in order to become more modern at the time.
To be more specific, C++ has a very identical syntax to C in general, but shares the OOP concepts that Java also uses. This includes classes, polymorphism, encapsulation, inheritance, and a number of other concepts. The gist is that C++ provides an easy to understand platform for both new and old programmers to communicate easily about.
This guide isnt meant to bog you down in terminology though. Once you learn any one programming language, the next will be easier so long as its in the same family. Meaning, C++ will help you learn Java which will help you learn C# and so on. The best way to choose a programming language is to find a feel for how you might like to program. This could mean writing speech like statements as in QBASIC, or writing esoteric coding magic as in Ook-Ook. In this case, we need a language that will easily introduce the initial aspects of programming while still being flexible enough for more advanced topics; therefore, we choose the C++ programming language.
Now that were up to speed on the general view that our programming language holds, we can start to tackle some of the preliminary objectives of setting up our programming environment. This will include an editor, a compiler and a file directory structure. The editor is where you will actually write your code. The compiler will take your code and make an executable application that will run on your computer. The only purpose of the file directory structure is to minimize confusion as to where your files are being saved while youre coding. Shall we begin?
Chapter 1: Installing Cygwin: Linux-Like Development
The first step is to get the compiler. The reason is that this will force some constraints on how your program will run after the compiler process it. An example of this is that there are some compiler specific macros, such as __sync_synchronize from the gcc compiler that will add some extra instructions that you dont have to add yourself.
Compiler concepts aside, there are some other issues with using different compilers with the same program. Compiler warnings will also cause some unneeded confusion whenever youre trying to find problems with your code. The selection of a compiler can also be limited because of consensus over one particular compiler causing a stagnation of further research.
Another perk to using the Cygwin package is that it follows a similar format to the default Linux compiler. The specific compiler well be using from the Cygwin package is the g++ compiler which will have a few quirks about it, but itll help to get us intimate with the code well enough that we dont just hit a magical button to get executable code, like some other integrated development environments (IDE).
Theres plenty of research being done about compilers in general. Concepts that are applied include formal languages, automata, and various other more advanced topics. If you have further interest as to how compilers work under the hood, there are plenty of resources available online as well as some easy to understand explanations of the most popular compilers.
Click this link to grab Cygwin.
Once thats installed, there are few other things that you can do now. The Linux operating system uses the bash different scripting language whereas Windows uses batch. The difference between bash and batch are fairly numerous, but both share some general functionality. Mentioning this, Cygwin actually adds in some of the commands that bash has, but Windows makes a little more complex.
The pwd command is going to be useful later, since it will print the working directory that the command prompt, or terminal, is using as its place to execute commands.
Chapter 2: Installing Notepad++: Going from Text to Code
The next thing that well need to download is the code editor. The difference between a code editor and a simple text editor is primarily apparent in the fact that the former will provide some helpful syntax highlighting, among other features.
Syntax of a language encompasses the keywords, grammatical structure, and whitespace parsing as well as other pieces. The purpose of syntax in coding is fairly identical to syntax applied to language in general. It provides an agreed upon structure of the form of a statement.
The keywords of a language are special words which are unique to programming. These include loop structures such as for, while, and do-while; data types are also included such as float, double, string, and so on.
The grammatical structure important in coding is primarily the placement of separators. More specifically, the way that a language would want us to form functions, what to call the entry function, and whether or not a statement requires a terminator. An example of the latter is using semicolon basically as a period in C++ and other languages.
The last mention was primarily for a language called Python. It uses tabs as an indicator for whether or not the next line is part of a function, loop, or class block. Its got a likeably different flavor than C++ and might be worth a look into after wrapping our heads around the basic programming ideas we still need to cover.
Click this link here to grab Notepad++.
The best part is that this one code editor will highlight not just C++, but plenty of other languages as well. Linux also uses a hybrid text and code editor called gedit, which is another cool point about Notepad++. Funny that were basically just trying to make Windows more like Linux so we can program, eh?
Chapter 3: Setting up the Workspace: File Structure Is Key
The final setup step is here. This one some would say is optional; however, think about this quick scenario. Say that theres a really large project that youre tasked to help develop. There are other coders with you. They each have their own way of doing things, which can already spell some problems early on. One of them asks you for some help with his piece. He tries to explain it quickly, but youre already lost as you try to go inside of folder after folder of software. An interface here and a realization there, with some utilities in another folder way over here. See the problem?
Next page