ebook img

Fishing in C++: C Programming for Beginners PDF

272 Pages·2015·1.5 MB·English
by  Jha
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Fishing in C++: C Programming for Beginners

Fishing in C++ C++ programming for beginners By Aman Kumar Jha Dedicated To My Mummy and Papa All the software, company names, trademarks and websites discussed in this book are the sole property of their owner and the author has no formal or informal relation with them. These have been discussed for education purpose only and author has no intention to violate their copyright laws. If any person tries to misuse these names through this book then he will be solely responsible for his deed and will be liable to criminal prosecution and civil claims for damages. © 2015 All rights reserved. No part of this book may be reproduced or transmitted, in any form or by any means, without the written permission. Any person who does any unauthorised act in relation to this book may be liable to criminal prosecution and civil claims for damages Words by Author I am Aman. This is my third book after one of the most controversial book, “Hacking: Exploiting computer security with Aman”. Well, programming is called an indispensible part of hacking. However, in this book I have not written to the hacking level. I have written, just to introduce programming to the beginners. Whatever, I have written is fully experimental and that will work on most of the C++ compilers. I have filled this book with a lot of programs and I expect that while reading the book, you have a compiler open there, if not, fret not, I have described output of the programs. So, let us begin our journey with this excitement. Aman Kumar Jha [email protected] facebook.com/amankumar100 Contents Introduction First C++ Program: Hello World Comments Variables, constants and Keywords Character sets Keywords Variables Variable constraint: Limitations of variables Difference between declarations and definitions: Declarations Definitions scope resolution operator(::) Formatted Input/Output cout (<<) Introduction To display a character To display a string To display a number To display the value stored in a variable Cascading nature of cout \a Audible beep \b Backspace \f Formfeed \n Newline \r Carriage return \t Tab Various uses of backslash puts() function cout.put() cout.write() endl oct, dec, hex iomanip.h setbase() setprecision() setw() cin (>>) Cascading input gets() cin.get() cin.getline(char*,int l,char t) cin.read(unsigned char*,int l) oct, dec, hex setbase() Increment & decrement operator (++ & --) Type casting Constants Shorthand notation Decision control if...else Nested if...else Else If ladder Logical operators Switch statement Loops for loop while loop Do...while loop goto keyword Break and Continue Functions void Recursion Variables Revisited Auto Static Register Extern Default arguments Function overloading Inline Functions Pointers Call by value and call by reference Call by value Call by reference using pointers Call by reference without using pointers Returning a pointer Pointer Arithmetic Array Array declaration and initialization Bound checking Passing array elements to the function Passing Entire array to the function Multidimensional array Returning an array Method1: Returning the array using pointers Method2: Returning an array using reference Strings Array of strings Passing string to the function Call by value Returning a string Strlen Strcpy Strcmp Stricmp Union and Enumeration Enumeration Array of enum Passing enum to the function Call by value Call by reference using pointers Call by reference without using pointers Returning an enumeration Union Array of union Passing union to the function Call by value Call by reference using pointers Call by reference without using pointers Returning a union typedef #define Structures Input/output in structure Array of structures Copying one structure to another Method1: Copying each and every element Method2: Copying the structure itself Passing structure elements to a function Passing entire structure to the function Structure as return type Structure as a pointer File operations Useful functions Useful macros Modes to open a file Writing to a file Reading characters from a file Reading entire file: Character by character Reading a string from a file File position pointer Using state flags badbit and bad() failbit and fail() eofbit and eof() goodbit and good() is_open() clear() Operating multiple files simultaneous Binary files read() and write() functions Writing a Structure to a file: Method1 Reading a structure from file:Method1 Writing and reading Structures from files : Method2 Class Constructors Constructor overloading Default Constructor Copy Constructor Destructor Defining the methods inside the class Passing a class to a function Returning a class Friend class this pointer Inheritance Accessibility in inheritance Types of inheritance Single inheritance Multilevel inheritance Hierarchical inheritance Multiple inheritance Hybrid inheritance Operator overloading Overloading increment and decrement operator(++ &--)

Description:
Overview: Best C++ programming book for beginners. See contents below cover.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.