Learn C++
By Durgesh
4.5/5
()
About this ebook
C++ (C plus plus) is a general purpose programming language based on the C programming language. In addition to facilities provided by C, C++ provides classes, inline functions, operator overloading, constant type references, free store management operators, etc.
The new language was known as "C with classes" initially. However in 1983, the name was changed to C++. C++ blends the high efficiency and stylistic elements of C with the object-oriented paradigm. It is a machine-independent language and is considered an industry standard language. C++ has been in use for large software projects. Stability and compatibility have been important considerations in the development of the language.
The development of C++ was not an attempt to create a completely new programming language. Instead it was an enhancement to an already highly successful one. C++ was standardized on 1977 and the ANSI / ISO (American National Standards Institute / International Standards Organization) standard for C++ is now available.
Durgesh
Major part of my career has been in the field of Education and Administration. I have a good command over my subject (computer science) and effective communication in English. I have written books in my subject and have represented Science Olympiad Foundation. I have been very adaptable to any kind of new environment and technologies. I have written a few computer science books for my students based on their syllabus.With lots of health issues cropping up with time, I recreated myself with the help of Yoga and Meditation. Which gave me a direction towards a happy mind and body.Thus, decided to share my experience in penning down the Good Health Technique with all.I am ever grateful to Guruji, Sri Sri Ravi Shankarji and to Swami Satyananda Saraswatiji for guidance towards ultimate physical and mental good health.Lately I have picked up a new hobby - the art of crocheting. While making some crochet related products, I have written a few amigurumi patterns. Sharing my new skill through this platform.
Read more from Durgesh
Learn All about Evolution of Computers Rating: 0 out of 5 stars0 ratingsLearn Typing Rating: 0 out of 5 stars0 ratingsC Language Programming Codes Rating: 0 out of 5 stars0 ratingsYoga (Pawanmuktasana) Rating: 3 out of 5 stars3/5Learn All About Cyber Safety Rating: 0 out of 5 stars0 ratingsEnjoy with Computers Rating: 0 out of 5 stars0 ratingsLearning Open Office: Writer, Impress, Draw Rating: 0 out of 5 stars0 ratingsBasic Language Rating: 0 out of 5 stars0 ratingsHappiness with Meditation & Yoga Rating: 0 out of 5 stars0 ratingsOpen Source: Introduction & Outline of Office Suite Rating: 0 out of 5 stars0 ratingsAmigurumi Patterns of 2 Bunnies Rating: 0 out of 5 stars0 ratingsLearning Open Office: Calc & Base Rating: 0 out of 5 stars0 ratings
Related to Learn C++
Related ebooks
C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming Rating: 4 out of 5 stars4/5Beginning C++ Programming Rating: 3 out of 5 stars3/5C++ Programming Language Rating: 0 out of 5 stars0 ratingsC Programming Language Essentials Rating: 4 out of 5 stars4/5C Programming Concepts Rating: 0 out of 5 stars0 ratingsC++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsIntroduction to Algorithms Rating: 0 out of 5 stars0 ratingsProblem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Computer Programming Using C Rating: 0 out of 5 stars0 ratingsAssembly Language:Simple, Short, And Straightforward Way Of Learning Assembly Programming Rating: 2 out of 5 stars2/5Advanced C Concepts and Programming: First Edition Rating: 3 out of 5 stars3/5C# Functions and Tutorial - 50 Examples Rating: 0 out of 5 stars0 ratingsIntroduction to Programming Languages Rating: 4 out of 5 stars4/5Mastering C# and .NET Framework Rating: 5 out of 5 stars5/5Update to Modern C++ Rating: 0 out of 5 stars0 ratingsBasic Language Rating: 0 out of 5 stars0 ratingsMicrosoft Visual C++ Windows Applications by Example Rating: 4 out of 5 stars4/5Python from the Very Beginning Rating: 0 out of 5 stars0 ratingsC++ Functions and tutorial Rating: 0 out of 5 stars0 ratingsPython: Advanced Guide to Programming Code with Python: Python Computer Programming, #4 Rating: 0 out of 5 stars0 ratingsVisualizing Data Structures Rating: 0 out of 5 stars0 ratingsData Structures in C / C ++: Exercises and Solved Problems Rating: 0 out of 5 stars0 ratingsModern C++ Programming Cookbook Rating: 5 out of 5 stars5/5Introduction to C++ Programming Rating: 3 out of 5 stars3/5Computer Programming In C Language Rating: 4 out of 5 stars4/5C Programming for Beginners: Your Guide to Easily Learn C Programming In 7 Days Rating: 4 out of 5 stars4/5C in 30 Pages Rating: 5 out of 5 stars5/5Teach Yourself C++ Rating: 4 out of 5 stars4/5Efficient C/C++ Programming: Smaller, Faster, Better Rating: 3 out of 5 stars3/5C++ Programming Complete Self-Assessment Guide Rating: 0 out of 5 stars0 ratings
Study Guides For You
Summary of The 48 Laws of Power by Robert Greene Rating: 4 out of 5 stars4/5Summary: The Subtle Art of Not Giving a F*ck by Mark Manson Rating: 4 out of 5 stars4/5Summary of 12 Rules For Life: An Antidote to Chaos by Jordan B. Peterson Rating: 4 out of 5 stars4/5Summary of Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones by James Clear Rating: 5 out of 5 stars5/5Summary of When Things Fall Apart: Heart Advice for Difficult Times by Pema Chödrön Rating: 4 out of 5 stars4/5Summary of How to Know a Person By David Brooks: The Art of Seeing Others Deeply and Being Deeply Seen Rating: 3 out of 5 stars3/5Gone Girl: A Novel by Gillian Flynn | Conversation Starters Rating: 4 out of 5 stars4/5Summary of Tomorrow, and Tomorrow, and Tomorrow A Novel by Gabrielle Zevin Rating: 3 out of 5 stars3/5The 5 AM Club Summary: Business Book Summaries Rating: 4 out of 5 stars4/5Workbook & Summary of Becoming Supernatural How Common People Are Doing the Uncommon by Joe Dispenza: Workbooks Rating: 0 out of 5 stars0 ratingsBarron's American Sign Language: A Comprehensive Guide to ASL 1 and 2 with Online Video Practice Rating: 3 out of 5 stars3/5Fifty Shades Trilogy by E.L. James (Book Analysis): Detailed Summary, Analysis and Reading Guide Rating: 5 out of 5 stars5/5Summary of Young Forever by Mark Hyman M.D.: The Secrets to Living Your Longest, Healthiest Life Rating: 0 out of 5 stars0 ratingsQuick Guide: Are You There God? It's Me, Margaret. Rating: 4 out of 5 stars4/5Summary of Make Your Bed: Little Things That Can Change Your Life… And Maybe the World by William H. McRaven Rating: 4 out of 5 stars4/5Summary of The Creative Act: A Way of Being | A Guide To Rick Rubin's Book Rating: 3 out of 5 stars3/5Summary of Spare By Prince Harry The Duke of Sussex Rating: 2 out of 5 stars2/5A Court of Thorns and Roses: A Novel by Sarah J. Maas | Conversation Starters Rating: 5 out of 5 stars5/5Summary of Eat to Beat Disease by Dr. William Li Rating: 5 out of 5 stars5/5Summary of You Are a Badass by Jen Sincero Rating: 5 out of 5 stars5/5Summary of Scarcity Brain By Michael Easter: Fix Your Craving Mindset and Rewire Your Habits to Thrive with Enough Rating: 0 out of 5 stars0 ratings
Reviews for Learn C++
9 ratings0 reviews
Book preview
Learn C++ - Durgesh
Learn C++
For My Computer Sc. Students
By Durgesh
Contents
1. C Character Set
2. Data Types
4. C++ Tokens
5. Operators
6. Use of I/O Operators
7. Structure of C++ Program
8. Operators & Expressions
9. Precedence of Operators
10. Expressions
11. Program Control Statements
12. Selective Structure: switch
13. Iterative Statement: for Loop
14. Iterative Statement: while Loop
15. Iterative Statement: do-while Loop
16. Bifurcation of Control
17. I/O Functions
18. Single Character Functions
19. Structured Data Type: Arrays
20. Types of Arrays
21. Strings
22. Functions
23. Scope Rules
24. Header Files
25. Character and String Functions
26. Math & Conversion Functions
27. Structures
28. Structures and Arrays
29. Classes and Objects
30. Constructors
31. Destructors
32. Function Overloading
33. Inheritance
34. Pointers
35. Memory Management
36. Input/Output of Files
Introduction
C++ (C plus plus) is a general purpose programming language based on the C programming language. In addition to facilities provided by C, C++ provides classes, inline functions, operator overloading, constant type references, free store management operators, etc.
By adding object-oriented features attributes and benefits, C++ was developed by Bjarne Stroustrup in 1980. The new language was known as C with classes
initially. However in 1983, the name was changed to C++.
The development of C++ was not an attempt to create a completely new programming language. Instead it was an enhancement to an already highly successful one. C++ was standardized on 1977 and the ANSI / ISO (American National Standards Institute / International Standards Organization) standard for C++ is now available.
C++ blends the high efficiency and stylistic elements of C with the object-oriented paradigm. It is a machine-independent language and is considered an industry standard language. C++ has been in use for large software projects. Stability and compatibility have been important considerations in the development of the language.
C++ Character Set
Character sets affect the fundamental part of the program code, the storage and transmission of data and the logic with which you manipulate text.
Source Code Character Set
A C++ compiler uses any character set that includes at least the following characters:
The 52 upper case and lower case alphabetic characters ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z ), the 10 decimal digits ( 0 1 2 3 4 5 6 7 8 9 ), the blank or space character and 29 designated graphic characters ( ! # % ^ - _ + = ~ [ ] \ | ; : ' " { } . , < > / ? ).
Five formatting characters (backspace horizontal tab, vertical tab, form feed, and carriage return) are often used in C++ (formatting characters are treated as spaces). The dollar sign ($) and the at sign (@) are also commonly used.
Execution Character Set
The execution character set for C++ is required to have the standard characters of the source code character set, plus a null character and a new line character. This null character must have the value 0 and is used to mark the end of strings.
White Space
White space in C++ includes the blank (space character), horizontal tab, end-of-line, vertical tab, form feed, and comments. White space is ignored by the compiler and therefore can be freely used by the programmer.
Line Termination
Each line in a C++ source program is terminated with an end-of-line character or character sequence. Certain formatting (such as carriage return, form feed or vertical tab) can also terminate lines.
Data Types
Data type is defined as the set of possible values a variable can hold. Data types in C++ can be divided into three categories:
1. Built-in Data Type
2. User Defined Data Type
3. Derived Data Type
Built-in Data Types
The C++ compiler supports all the built-in data types. These data types are also known as standard data types and are not composed of other data types.
Data type modifiers
A modifier is used to change the meaning of the basic data type according to the requirement of the program. The modifiers signed, unsigned, long, and short may be applied to basic data types (integer, character). Long float is not used because it is equivalent to double. Modifiers cannot be used with void type.
Data Types and sizes
Type Number of Bits
char 8
short 16
int 32
long 32
float 32
double 64
void none
Integers
Integer data types (int) are whole numbers in use in C++. The size of integers is 2 bytes. Three types of integers are used in C++.
1. Signed / unsigned integers
2. Short integers
3. Long Integers
Signed Integer
A signed integer (signed int) is a positive or negative integer. The range of signed integers is from -32768 to +32767.
Unsigned integer
Unsigned integers do not have negative values. These integers accept only zero and positive values. The size of unsigned integers is 2 bytes. They can range from 0 to 655357.
Short integers
Short integers have a small range of values. The range of short integers is from -128 to 127. The size is 1 byte.
Long integers
The range of long integers is from -2^32 to 2^32. The size is 4 bytes.
Examples of valid integers: 439, 11, 20495, -126
Examples of invalid integers: 961.21 (float), 4,325 (comma is not allowed), 81 562 (blank space within a number is not allowed).
Floating point (float)
Floating point variables are used to store real numbers (numbers involving decimals). The range of floating point type is from 3.4 x 10^-38 to 3.4 x 10^38 and the size is 4 bytes. Type float provides approx. 7 digits of precision. Three types of floats are used in C++: Float, Double, Long Double. A floating point number can be represented in two forms: decimal form and exponent form.
Examples of Decimal form: 250.46, -1738.72, 8.39
Examples of Invalid Float: 16,433.67 (comma used), -84 (no decimal point)
Examples of Exponent Form: 52940000 -- 5.294 x 10^6
0.8731 -- 8.731 x 10^-1
0.4269 -- 4.269 x 10-8
Examples of Valid Forms
4.321 x 10^6 = 4.321E6
= 4.321E+6
= 4.321E06
4.321 x 10^-6 = 4.321E-6
The part to the left of