Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming
C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming
C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming
Ebook281 pages1 hour

C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming

Rating: 4 out of 5 stars

4/5

()

Read preview

About this ebook

This book is for absolute beginners with or without prior knowledge in programming, as this book uses Simple words, Short sentences, and Straightforward paragraphs. The triple S way of learning C++ programming. C++ (pronounced as cee plus plus) is a general-purpose programming language. The main object of C++ is to add object-orientation to its predecessor C language. C++ has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. There are also other useful features added to C++ such as inheritance and polymorphism. The topics covered in this book includes brief introduction to C++ programming, variables, data types, control structures, functions, pointers, and file management of external files. This book starts its discussion from short history to installation of the needed software resource and a step by step screen shots of how to write C++ programming code, compile and execute C++ programs. It presents graphical representation of algorithms for simpler learning. This book is packed with working and running C++ program samples and after reading this book, the reader would be able to develop and create C++ language programs based particularly from problems given in computer science courses, hence, adopting to other programming language will be a lot easier. This book is your initial step in your programming career.

LanguageEnglish
Release dateJun 11, 2020
ISBN9780463106907
C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming
Author

Sherwyn Allibang

Sherwyn Allibang has 10 years experience in the academe as college professor handling business and IT related subjects. Aside from his career as an academe, he is also a freelance software developer catering system development from project management to core programming. With the degree in Bachelor of Science in Information Technology, Master in Business Administration, Master in Information Technology, and Doctor in Business Administration, Sherwyn is a solutions-focused, team oriented IT Specialist, with broad-based experience and hands-on skill in the successful implementation of highly effective technical support strategies. A proven ability to successfully analyze an organization's critical support requirements, identifies deficiencies and potential opportunities, and develops innovative solutions for increasing reliability and improving productivity.

Read more from Sherwyn Allibang

Related to C++ Programming Language

Related ebooks

Electrical Engineering & Electronics For You

View More

Related articles

Reviews for C++ Programming Language

Rating: 4 out of 5 stars
4/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    C++ Programming Language - Sherwyn Allibang

    C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming

    Copyright 2016 - KDP Edition

    Sherwyn Allibang

    Edition License Notes

    This book is authorized for your own personal use. This book may not be re-sold or offered away to other individuals. Much thanks to you for regarding the diligent work of the author.

    Introduction

    This book is for absolute beginners with or without prior knowledge in programming, as this book uses Simple words, Short sentences, and Straightforward paragraphs. The triple S way of learning C++ programming. C++ (pronounced as cee plus plus) is a general-purpose programming language. The main object of C++ is to add object-orientation to its predecessor C language. C++ has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. There are also other useful features added to C++ such as inheritance and polymorphism. The topics covered in this book includes brief introduction to C++ programming, variables, data types, control structures, functions, pointers, and file management of external files. This book starts its discussion from short history to installation of the needed software resource and a step by step screen shots of how to write C++ programming code, compile and execute C++ programs. It presents graphical representation of algorithms for simpler learning. This book is packed with working and running C++ program samples and after reading this book, the reader would be able to develop and create C++ language programs based particularly from problems given in computer science courses, hence, adopting to other programming language will be a lot easier. This book is your initial step in your programming career.

    TO GOD BE ALL THE GLORY!

    The resources used in this book are:

    > Personal Computer running Windows 7 Operating System

    > Dev-C++ available at http://bloodshed.net

    Other Operating Systems can also be used and you may also ought to use other C++ compilers or IDE.

    NOTE: All links provided in this book are updated occasionally. If a link becomes unavailable, email me at zherwyndbest@facebook.com

    Table of Contents

    Acknowledgement

    Dedication

    Chapter 1 - Starting C++ Language Programming

    Brief history of C++

    Reasons to use C++

    Beginning to Program in C++ Language

    Installing the Dev-C++ for Windows

    Installing compiler for Linux

    Self-assessment questions

    Chapter 2 - Our First C++ Program

    Definition of programming terms

    The components of a C++ program

    Writing, compiling, and running our first program using Dev-C++ for Windows

    Correcting errors

    Writing, compiling, and running our first program with Linux

    Compiling and running the program on Linux

    Statements

    Null Statements

    White spaces

    Self-assessment questions

    Chapter 3 - Storing Data: Variables and Data Types in C++

    Variable

    Variable Declaration and definition

    Scope of variables

    Constants

    Keywords

    typedef declarations

    Self-assessment questions

    Chapter 4 - Fundamentals of Input And Output in C++

    Displaying text on-screen

    Accepting user input

    Self-assessment questions

    Chapter 5 - Arrays and Strings in C++

    Array

    Single-Dimensional

    Multi-Dimensional Array

    The C-Style Character String

    Declaring and defining a string

    Defining a string using input functions

    C Strings' pre-defined functions in C++

    Self-assessment questions

    Chapter 6 - Mathematical Operations in C++

    Expressions

    Operators

    Assignment Operator

    Mathematical Operators

    Binary

    Unary

    Mathematical operators precedence level and parentheses

    Relational Operators

    Logical Operators

    Type Casting

    Pre-defined Mathematical Functions

    Self-assessment questions

    Chapter 7 - Conditional Statements in C++

    The if() statement

    Single-alternative

    Dual-alternative

    Multiple-alternative

    Nested if() statement

    The switch() statement

    Things to consider in conditional statement:

    Self-assessment questions

    Chapter 8 - Looping Statements in C++

    What is a Loop?

    Counter-controlled loop

    Nested for() loop statement

    Condition-controlled loop

    Pre-test loop

    Post-test loop

    The Infinite Loop

    Self-assessment questions

    Chapter 9 - User-Defined Functions in C++ Language

    User-defined function

    User-defined function prototype

    User-defined function definition

    Calling a user-defined function

    Things to consider in functions

    Self-assessment questions

    Chapter 10 - User-Defined Data Types in C++

    Structures

    Declaring a structure

    Defining a structure

    Accessing Structure Members

    Compound declaration and definition of structure

    Self-assessment questions

    Chapter 11 - Classes in C++

    What is a class?

    Creating New Types

    Classes and Members

    Declaring of a Class in C++

    Definition of a Class member method(s) in C++

    Defining an Object of a class

    Accessing Class Members

    Private versus public access controls

    Constructor and destructor

    Self-assessment questions

    Chapter 12 - Exception Handling in C++

    What is exceptions?

    How Exceptions Are Used

    The basic steps in using exceptions

    Self-assessment questions

    Chapter 13 - Pointer in C++

    Pointers in C++

    Pointer Declaration

    How pointers works?

    Pointer Arithmetic

    Self-assessment questions

    Chapter 14 - File Management in C++

    C++ Files and Streams

    Opening a File

    Closing a File

    Writing to a File

    Reading from a File

    Self-assessment questions

    Answers to self-assessment questions

    Ending Notes

    Disclaimer

    About the Author

    Acknowledgements

    The author wishes to express his heartfelt gratitude to the Almighty God for His grace, wisdom, and guidance and for giving the author the determination to write this book. This book would not have been possible without the support and help of several individuals who in one way or another contributed and extended their valuable assistance in the preparation and completion of this material. The author offer his regards and blessings to all of those who supported him in any respect during the completion of this book.

    Dedication

    The author dedicates this book to the ALMIGHTY GOD.

    This book is also dedicated to Dennis Ritchie for giving the author the tools to program and to Bill Gates for giving the author the reasons to program.

    Chapter 1 - Starting C++ Language Programming

    This chapter presents a brief overview of C++ programming. C++ was designed with a basis toward system programming with high performance, efficiency and flexibility of use as its design highlights. This chapter presents the things needed in starting C++ programming.

    Brief history of C++

    The C++ programming language has a history path in 1979. Bjarne Stroustrup, a Danish computer scientist, is working with the language called Simula, which is a language principally intended for simulations. The Simula 67 language underpins object-oriented programming paradigm. Stroustup started working with C with classes. C is considered as middle-level language which has the power of Low-level language but has high-level language features and C is considered as the predecessor of C++. Bjarne Stroustrup, at Bell Labs designed C++ in the early 80s, as an object oriented language based on the C language, which powered pretty much all systems software since its creation in 1972. The first C with Classes compiler was called Cfront, which was derived from a C compiler called CPre. C++'s goal is to add object-oriented programming into C language. The ++ operator in the C language is an operator for incrementing a variable, which gives some insight into how Stroustrup regarded the language. In 1985, Stroustrup's reference to the language entitled The C++ Programming Language was published.

    Reasons to use C++

    To start with, C++ is highly recommended for beginning programmers in starting their programming career because C++ covers both procedural and object-oriented programming approach. Once someone learned the concepts behind programming language with C++, adopting or migrating to other programming language will be a lot easier whether it's object-oriented or procedural-oriented programming, as most of the things needed are pretty similar.

    C++ has been around a while and it has solved several industry challenges considering that it is also the primary language that drives the mobile experience today. In addition to high performance server and middleware, C++ is a great choice for client side development on the two most popular mobile platforms Android and iOS and the two most popular desktop platforms, Windows and Mac OS X. With the recent introduction of developer tools that enable, among other things, visual design for clients, middleware, and server side apps; C++ is extremely productive and really makes it a great choice for modern app development, so learning the basics of C++ will make someone be competitive in the industry's stiff competition.

    This book will bring the world of C++ programming closer to you.

    Beginning to Program in C++ Language

    All the C++ programs are written into text files with extension .cpp for example hello.cpp, where .cpp is the extension file name. These text files are called source files. The source files contains the C++ source codes and will later be transformed into a running executable file. The program development cycle of C++ language are:

    1. Write the source codes into a text editor (ex: notepad) to create the source file.

    2. Compile the source file to create the object file.

    3. The object file is link into an executable (ex: .exe for windows) file.

    4. Run the program and see the result.

    Based from the program development cycle of C++, notice that there are several things needed which includes a text editor, a compiler, and a linker. The good news is that, for Windows users, there is a software that comprises the three. It is called Dev-C++ which is available at http://bloodshed.net and for the download direct link at http://bloodshed-dev-c.en.softonic.com/download.

    Dev-C++ is a C++ source code editor, a compiler, and a linker. All the things needed in creating a C program.

    Note: You may ought to use other compilers as the sample codes in

    Enjoying the preview?
    Page 1 of 1