Professional Documents
Culture Documents
C
C
Resources
C++ primer plus by Stephen Prata
(pdf: https://www.google.co.in/# q=C%2B%2B+Primer+plus )
The C++ Programming Language by Bjarne Stroustrup
Programming Principles and Practices by Bjarne Stroustrup
Effective C++ by Scott Meyers
Effective STL
http://www.cplusplus.com/doc/tutorial /
https://isocpp.org/faq
Stanford C Lectures: https://
www.youtube.com/watch?v=Ps8jOj7diA0&list=PLjn3WmBeabPO
UzxcCkzk4jYMGRZMZ6ylF
C+ + Features
Abstraction
Inheritance
Polymorphism
STL Library (Containers)
Overloading
Overriding
compil
e
Object file
1
Source
file 2
compil
e
Object file
2
link
Executable
file
Contd
Array Initialization:
int v1[] = {1,2,3,4}, int v2[4] = {1, 2}
v1 = v2 // error: no array assignment
String Literals: character sequence enclosed with
double quotes, terminated by null character
this is a string, sizeof(Bohr) = 5, strlen(Bohr) = 4
Literal string storage is different than character array
Contd
Literal String assignment:
const char *p = Plato // pointer to const char
p = zinga
char *p = apple
p[1] = c
p[1] = a p++
char *q = p // implicit conversion of char[] to char *
sizeof (q) is different than sizeof(p)
ptr->b
Contd
Pointer drawbacks:
Contd
Reference differs from pointer in following way:
to access memory reference syntax is same as object name
struct s &ref = a; // reference must be initialized to some
object
ref.b = 5
reference always refers to the object to which it was initialized
struct s &ref = b
there is no null reference
struct s &ref
END