This document provides information about an Advanced C++ summer school course including details about the course schedule, evaluation criteria, prerequisites, and an introduction to structures and classes in C++. The course will be held from June 23-27, 2014 from 2:30-4:00 pm daily. Evaluation will be based 50% on an end of semester exam and 50% on assignments and in-class quizzes. A good command of C/C++, pointers, and structures is required. The document then provides information on using structures and classes to organize data in C++ programs.
Classes extend the built-in capabilities of C++ able you in representing and solving complex, real-world problems. A class is an organization of data and functions which operate on them. Data structures are called data members and the functions are called member functions, the combination of data members and member functions constitute a data
object or simply an object.
Class is a group of data member and member functions. Another word class is a collection of objects of similar type.
To create a class, use the class keyword followed by a name for the object. Like any other declared variable, the class declaration ends with a semi-colon. The name of a class follows the rules we have applied for variable and function names.
JavaScript, the good parts + syntactic sugar = CoffeeScript geekQ
JavaScript is an increadibly powerful and widely adopted language. It powers the web site, you are looking at, and probably the entertainment system in your next car. It allows for functional programming and offers prototype based inheritance.
Unfortunately, it’s most language constructs are awkward (phony arrays, new, 0 == ”), frequently misunderstood (this, prototype, ==, for) and lead to an error prone and unmaintanable code (lexical scope, globals).
Best solution is to learn the JavaScript language in more depth (I recommend “JavaScript: The Good Parts” by Douglas Crockford) and to use code style checker JSLint.
In addition you can create more readable, reliable applications with CoffeeScript, a little language that keeps the original concepts, compiles into JavaScript and facilitates JavaScript best practices. Lets see, what CoffeeScript can do for you…
(as presented at FrankfurtJS, October 2014)
Classes extend the built-in capabilities of C++ able you in representing and solving complex, real-world problems. A class is an organization of data and functions which operate on them. Data structures are called data members and the functions are called member functions, the combination of data members and member functions constitute a data
object or simply an object.
Class is a group of data member and member functions. Another word class is a collection of objects of similar type.
To create a class, use the class keyword followed by a name for the object. Like any other declared variable, the class declaration ends with a semi-colon. The name of a class follows the rules we have applied for variable and function names.
JavaScript, the good parts + syntactic sugar = CoffeeScript geekQ
JavaScript is an increadibly powerful and widely adopted language. It powers the web site, you are looking at, and probably the entertainment system in your next car. It allows for functional programming and offers prototype based inheritance.
Unfortunately, it’s most language constructs are awkward (phony arrays, new, 0 == ”), frequently misunderstood (this, prototype, ==, for) and lead to an error prone and unmaintanable code (lexical scope, globals).
Best solution is to learn the JavaScript language in more depth (I recommend “JavaScript: The Good Parts” by Douglas Crockford) and to use code style checker JSLint.
In addition you can create more readable, reliable applications with CoffeeScript, a little language that keeps the original concepts, compiles into JavaScript and facilitates JavaScript best practices. Lets see, what CoffeeScript can do for you…
(as presented at FrankfurtJS, October 2014)
Front End Development - Beyond Javascript (Robin Cannon)Future Insights
Session slides from Future Insights Live, Vegas 2015:
https://futureinsightslive.com/las-vegas-2015/
Front-End Development is more than just a Javascript layer. Just because everything is single page apps and you’ve got Bootstrap to back up your Backbone, Ember or Angular, doesn’t mean you’re truly developing a presentation layer. Something that’s a truly great interface between the user and the back end requires the three pillars of front end web; javascript sure, but HTML and CSS are vital too. In this talk Robin redefines what it means to be a front-end developer, and explores frameworks that will help us to build things that users love. He'll cover the de-emphasis of HTML and CSS versus Javascript skills in front end web development, and the benefits of a broader approach that's only going to increase in importance as the Javascript MVC model matures.
Top 10 things a fresh programmer should know - Dao Ngoc KhanhDevDay.org
This session, targeted at newly graduates and students, shares some tips on how we can prepare a good foundation for a software career.
Topic present by Dao Ngoc Khanh - Developer at Axon Active Vietnam - at DevDay Da Nang 2015
Security in the Internet Of Things.
Every IoT project must be designed with security in mind. Identity Relationship Management is a must for a successful IoT implementation.
Keynote from ACCU 2015 conference (http://accu.org/index.php/conferences/accu_conference_2015)
@petegoodliffe
www.goodliffe.net
Synopsis:
You've come this conference to improve your skills. You're here to learn: to learn new technologies, to learn new techniques, and to fuel your passion by meeting like-minded people.
Becoming a better programmer means more than just learning new technologies. It means more than practising techniques and idioms. It's about more than passion and attitude. It's the combination of all these things. That's what this session will look at.
Pete Goodliffe, author of the new book Becoming a Better Programmer, unpacks important mindsets and techniques that will help you improve as a programmer.
You'll discover specific tools that will help you review your current skillset, and you'll learn techniques to help you “become a better programmer”.
A class definition consists of two parts: header and body. The class header specifies the class name and its base classes. (The latter relates to derived classes and is discussed in Chapter 8.) The class body defines the class members. Two types of members are supported:
Data members have the syntax of variable definitions and specify the representation of class objects.
Member functions have the syntax of function prototypes and specify the class operations, also called the class interface.
Class members fall under one of three different access permission categories:
Public members are accessible by all class users.
Private members are only accessible by the class members.
Protected members are only accessible by the class members and the members of a derived class.
The data type defined by a class is used in exactly the same way as a built-in type.
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSveerababupersonal22
It consists of cw radar and fmcw radar ,range measurement,if amplifier and fmcw altimeterThe CW radar operates using continuous wave transmission, while the FMCW radar employs frequency-modulated continuous wave technology. Range measurement is a crucial aspect of radar systems, providing information about the distance to a target. The IF amplifier plays a key role in signal processing, amplifying intermediate frequency signals for further analysis. The FMCW altimeter utilizes frequency-modulated continuous wave technology to accurately measure altitude above a reference point.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Saudi Arabia stands as a titan in the global energy landscape, renowned for its abundant oil and gas resources. It's the largest exporter of petroleum and holds some of the world's most significant reserves. Let's delve into the top 10 oil and gas projects shaping Saudi Arabia's energy future in 2024.
6th International Conference on Machine Learning & Applications (CMLA 2024)ClaraZara1
6th International Conference on Machine Learning & Applications (CMLA 2024) will provide an excellent international forum for sharing knowledge and results in theory, methodology and applications of on Machine Learning & Applications.
The Internet of Things (IoT) is a revolutionary concept that connects everyday objects and devices to the internet, enabling them to communicate, collect, and exchange data. Imagine a world where your refrigerator notifies you when you’re running low on groceries, or streetlights adjust their brightness based on traffic patterns – that’s the power of IoT. In essence, IoT transforms ordinary objects into smart, interconnected devices, creating a network of endless possibilities.
Here is a blog on the role of electrical and electronics engineers in IOT. Let's dig in!!!!
For more such content visit: https://nttftrg.com/
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Understanding Inductive Bias in Machine LearningSUTEJAS
This presentation explores the concept of inductive bias in machine learning. It explains how algorithms come with built-in assumptions and preferences that guide the learning process. You'll learn about the different types of inductive bias and how they can impact the performance and generalizability of machine learning models.
The presentation also covers the positive and negative aspects of inductive bias, along with strategies for mitigating potential drawbacks. We'll explore examples of how bias manifests in algorithms like neural networks and decision trees.
By understanding inductive bias, you can gain valuable insights into how machine learning models work and make informed decisions when building and deploying them.
4. Structures
How do you store the details of a person?
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
Information is not grouped in any way.
To pass your information to a function, you would have to
pass each variable independently.
If wanted to store information about many people, would have
to declare arrays.
5. Structures
How do you store the details of a person?
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
Information is not grouped in any way.
To pass your information to a function, you would have to
pass each variable independently.
If wanted to store information about many people, would have
to declare arrays.
6. Structures
How do you store the details of a person?
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
Information is not grouped in any way.
To pass your information to a function, you would have to
pass each variable independently.
If wanted to store information about many people, would have
to declare arrays.
7. Structures
How do you store the details of a person?
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
Information is not grouped in any way.
To pass your information to a function, you would have to
pass each variable independently.
If wanted to store information about many people, would have
to declare arrays.
8. Structures
How do you store the details of a person?
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
Information is not grouped in any way.
To pass your information to a function, you would have to
pass each variable independently.
If wanted to store information about many people, would have
to declare arrays.
9. Structures
C++ allows to create own user-defined data types to aggregate
different variables : structs
Structure declaration
struct Person{
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
}; //DO NOT forget a semicolon
Now person structure can be used as a built-in variable.
10. Structures
C++ allows to create own user-defined data types to aggregate
different variables : structs
Structure declaration
struct Person{
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
}; //DO NOT forget a semicolon
Now person structure can be used as a built-in variable.
11. Structures
C++ allows to create own user-defined data types to aggregate
different variables : structs
Structure declaration
struct Person{
char strName [20];
int nBirthYear;
int nBirthMonth;
int nBirthDay;
int nHeight;
}; //DO NOT forget a semicolon
Now person structure can be used as a built-in variable.
14. Structures
No memory is allocated in structure declaration
Size of a structure is the sum of sizes of it elements
Can pass entire structures to functions
void PrintInfo(struct Person p) {
cout << ‘‘Name: ’’ << p.name <<endl;
cout << ‘‘bDay: ’’ << p.nBirthDay <<endl;
}
int main () {
struct Person p1;
p1.name = ‘‘Pankaj ’’;
p1.nBirthDay = 20;
PrintInfo(p1);
}
15. Structures
No memory is allocated in structure declaration
Size of a structure is the sum of sizes of it elements
Can pass entire structures to functions
void PrintInfo(struct Person p) {
cout << ‘‘Name: ’’ << p.name <<endl;
cout << ‘‘bDay: ’’ << p.nBirthDay <<endl;
}
int main () {
struct Person p1;
p1.name = ‘‘Pankaj ’’;
p1.nBirthDay = 20;
PrintInfo(p1);
}
16. Structures
No memory is allocated in structure declaration
Size of a structure is the sum of sizes of it elements
Can pass entire structures to functions
void PrintInfo(struct Person p) {
cout << ‘‘Name: ’’ << p.name <<endl;
cout << ‘‘bDay: ’’ << p.nBirthDay <<endl;
}
int main () {
struct Person p1;
p1.name = ‘‘Pankaj ’’;
p1.nBirthDay = 20;
PrintInfo(p1);
}
17. Structures
Always have to use the word “struct”
No explicit connection between members of a structure and
the functions manipulating them
Cannot be treated as built-in types (c1 + c2 is not valid for
instances of “struct complex”)
Data hiding is not permitted (Why do we need this?)
All members of a structure are by defaut “public” (will be
discussed later)
18. Structures
Always have to use the word “struct”
No explicit connection between members of a structure and
the functions manipulating them
Cannot be treated as built-in types (c1 + c2 is not valid for
instances of “struct complex”)
Data hiding is not permitted (Why do we need this?)
All members of a structure are by defaut “public” (will be
discussed later)
19. Structures
Always have to use the word “struct”
No explicit connection between members of a structure and
the functions manipulating them
Cannot be treated as built-in types (c1 + c2 is not valid for
instances of “struct complex”)
Data hiding is not permitted (Why do we need this?)
All members of a structure are by defaut “public” (will be
discussed later)
20. Structures
Always have to use the word “struct”
No explicit connection between members of a structure and
the functions manipulating them
Cannot be treated as built-in types (c1 + c2 is not valid for
instances of “struct complex”)
Data hiding is not permitted (Why do we need this?)
All members of a structure are by defaut “public” (will be
discussed later)
21. Structures
Always have to use the word “struct”
No explicit connection between members of a structure and
the functions manipulating them
Cannot be treated as built-in types (c1 + c2 is not valid for
instances of “struct complex”)
Data hiding is not permitted (Why do we need this?)
All members of a structure are by defaut “public” (will be
discussed later)
22. Classes
Extension of structures
Class Definition
class class_name {
private:
variable declarations;
function declarations;
public:
variable declarations;
function declarations;
}; //DO NOT forget the semicolon
23. Classes
Extension of structures
Class Definition
class class_name {
private:
variable declarations;
function declarations;
public:
variable declarations;
function declarations;
}; //DO NOT forget the semicolon
24. Class: Example
Example
class item {
private:
int number; // variable declarations
float cost; // private by default!
public:
// function declarations through prototypes
void getData(int a, float b);
void putData(void );
}
25. Class
No memory allocated for a class definiton. It is only a “template”,
like a definition of a structure
26. Class: Public and Private
Private members are not directly accessible outside the class.
They are “hidden” from the outside world. The only way to
access them is by using public functions (if defined) which
manipulate them.
Public members can be accessed using the dot operator
(member selection operator). Eg. student.name,
item.getData()
27. Class: Public and Private
Private members are not directly accessible outside the class.
They are “hidden” from the outside world. The only way to
access them is by using public functions (if defined) which
manipulate them.
Public members can be accessed using the dot operator
(member selection operator). Eg. student.name,
item.getData()
28. Class: Objects
Class, like a structure definition, is a user-defined data type
without any concrete existance.
A concrete instance of a class is an object.
Memory is allocated for every object that is created.
An independent new set of variables is created for each object.
Public members can be accessed by using the dot operator on
the object while private members cannot be accessed directly.
29. Class: Objects
Class, like a structure definition, is a user-defined data type
without any concrete existance.
A concrete instance of a class is an object.
Memory is allocated for every object that is created.
An independent new set of variables is created for each object.
Public members can be accessed by using the dot operator on
the object while private members cannot be accessed directly.
30. Class: Objects
Class, like a structure definition, is a user-defined data type
without any concrete existance.
A concrete instance of a class is an object.
Memory is allocated for every object that is created.
An independent new set of variables is created for each object.
Public members can be accessed by using the dot operator on
the object while private members cannot be accessed directly.
31. Class: Objects
Class, like a structure definition, is a user-defined data type
without any concrete existance.
A concrete instance of a class is an object.
Memory is allocated for every object that is created.
An independent new set of variables is created for each object.
Public members can be accessed by using the dot operator on
the object while private members cannot be accessed directly.
32. Class: Objects
Class, like a structure definition, is a user-defined data type
without any concrete existance.
A concrete instance of a class is an object.
Memory is allocated for every object that is created.
An independent new set of variables is created for each object.
Public members can be accessed by using the dot operator on
the object while private members cannot be accessed directly.
33. Class: Objects
Object Creation
Just like variable declaration
Memory is allocated for every object that is created
Example:
item a;
item b,c,d;
34. Class: Objects
Object Creation
Just like variable declaration
Memory is allocated for every object that is created
Example:
item a;
item b,c,d;
35. Class: Objects
Object Creation
Just like variable declaration
Memory is allocated for every object that is created
Example:
item a;
item b,c,d;
36. Class: Objects
Object Creation
Just like variable declaration
Memory is allocated for every object that is created
Example:
item a;
item b,c,d;
37. Class: Function definitions
Outside the class
class Employee {
int empno , salary;
public:
void set(int roll , int sal);
};
void employee ::set(int roll , int sal) {
empno = roll;
salary = sal;
}
38. Class: Function definitions
Outside the class
class Employee {
int empno , salary;
public:
void set(int roll , int sal);
};
void employee ::set(int roll , int sal) {
empno = roll;
salary = sal;
}
39. Class: Function definitions
Inside the class
class Employee {
int empno , salary;
public:
void set(int roll , int sal) {
empno = roll;
salary = sal;
}
};
40. Class: Function definitions
Inside the class
class Employee {
int empno , salary;
public:
void set(int roll , int sal) {
empno = roll;
salary = sal;
}
};
41. Important Properties
Invoking other member functions from inside a member
function does not require explicit use of the object
Array size, if used inside classes, need to be determined at
compile time (for dynamic arrays, with size to be determined
at run time, “new” operator is used inside a constructor, will
be discussed later)
Arrays of objects are allowed (stored contiguously). Objects
can be used as members of some other class in nested fashion.
Objects, just like built-in types, can be return type of
functions.
Private functions and variables can only be accessed from
within the class.
42. Important Properties
Invoking other member functions from inside a member
function does not require explicit use of the object
Array size, if used inside classes, need to be determined at
compile time (for dynamic arrays, with size to be determined
at run time, “new” operator is used inside a constructor, will
be discussed later)
Arrays of objects are allowed (stored contiguously). Objects
can be used as members of some other class in nested fashion.
Objects, just like built-in types, can be return type of
functions.
Private functions and variables can only be accessed from
within the class.
43. Important Properties
Invoking other member functions from inside a member
function does not require explicit use of the object
Array size, if used inside classes, need to be determined at
compile time (for dynamic arrays, with size to be determined
at run time, “new” operator is used inside a constructor, will
be discussed later)
Arrays of objects are allowed (stored contiguously). Objects
can be used as members of some other class in nested fashion.
Objects, just like built-in types, can be return type of
functions.
Private functions and variables can only be accessed from
within the class.
44. Important Properties
Invoking other member functions from inside a member
function does not require explicit use of the object
Array size, if used inside classes, need to be determined at
compile time (for dynamic arrays, with size to be determined
at run time, “new” operator is used inside a constructor, will
be discussed later)
Arrays of objects are allowed (stored contiguously). Objects
can be used as members of some other class in nested fashion.
Objects, just like built-in types, can be return type of
functions.
Private functions and variables can only be accessed from
within the class.
45. Important Properties
Invoking other member functions from inside a member
function does not require explicit use of the object
Array size, if used inside classes, need to be determined at
compile time (for dynamic arrays, with size to be determined
at run time, “new” operator is used inside a constructor, will
be discussed later)
Arrays of objects are allowed (stored contiguously). Objects
can be used as members of some other class in nested fashion.
Objects, just like built-in types, can be return type of
functions.
Private functions and variables can only be accessed from
within the class.
46. Classes
Problem
Consider a class “car” which has the carNo, carModel, carMake
fields and relevant functions to modify them.
You have to count the number of objects of the class created.
How do you do it?
47. Classes
Problem
Consider a class “car” which has the carNo, carModel, carMake
fields and relevant functions to modify them.
You have to count the number of objects of the class created.
How do you do it?
48. Classes
Problem
Consider a class “car” which has the carNo, carModel, carMake
fields and relevant functions to modify them.
You have to count the number of objects of the class created.
How do you do it?
50. Static Members
Properties
Every static member needs to be defined outside the class as
well.
Only one copy of the static variable is shared among all objects
of the class.
Visible only within the class but exists for the lifetime of the
program.
No object instantiation is required to access static members.
51. Static Members
Properties
Every static member needs to be defined outside the class as
well.
Only one copy of the static variable is shared among all objects
of the class.
Visible only within the class but exists for the lifetime of the
program.
No object instantiation is required to access static members.
52. Static Members
Properties
Every static member needs to be defined outside the class as
well.
Only one copy of the static variable is shared among all objects
of the class.
Visible only within the class but exists for the lifetime of the
program.
No object instantiation is required to access static members.
53. Static Members
Properties
Every static member needs to be defined outside the class as
well.
Only one copy of the static variable is shared among all objects
of the class.
Visible only within the class but exists for the lifetime of the
program.
No object instantiation is required to access static members.
54. Static Members
Properties
Every static member needs to be defined outside the class as
well.
Only one copy of the static variable is shared among all objects
of the class.
Visible only within the class but exists for the lifetime of the
program.
No object instantiation is required to access static members.
55. Memory Allocation of Objects
For member functions and static variables, memory is allocated
when the class is defined, all objects of the class share the
same function code and static variables (every class does not
get its own copy). “this” pointer is implicitly passed so that
the function code is executed on the correct class instance.
For variables, memory is allocated when the object is defined.
Each instance gets its own set of variables.
56. Memory Allocation of Objects
For member functions and static variables, memory is allocated
when the class is defined, all objects of the class share the
same function code and static variables (every class does not
get its own copy). “this” pointer is implicitly passed so that
the function code is executed on the correct class instance.
For variables, memory is allocated when the object is defined.
Each instance gets its own set of variables.
57. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
58. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
59. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
60. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
61. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
62. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
63. Class: Friend
Shared functions among multiple classes
Properties:
Can access private members of the class
Often used in operator overloading
Not in the scope of the class. Cannot be called using an object
of the class.
Can be invoked like a normal function
Cannot access members of a class directly without an object of
the class
64. Class: Friend
Properties: (cont. . . )
Can be declared as either private or public without changing
the meaning
Objects can be passed to the function by value or by reference
A class can be defined to be the friend of another class. In
that case, all member functions of one class are friends of the
other class
65. Class: Friend
Properties: (cont. . . )
Can be declared as either private or public without changing
the meaning
Objects can be passed to the function by value or by reference
A class can be defined to be the friend of another class. In
that case, all member functions of one class are friends of the
other class
66. Class: Friend
Properties: (cont. . . )
Can be declared as either private or public without changing
the meaning
Objects can be passed to the function by value or by reference
A class can be defined to be the friend of another class. In
that case, all member functions of one class are friends of the
other class
67. Class: Friend
Properties: (cont. . . )
Can be declared as either private or public without changing
the meaning
Objects can be passed to the function by value or by reference
A class can be defined to be the friend of another class. In
that case, all member functions of one class are friends of the
other class
68. References
The C++ Programming Language
- Bjarne Stroustrup
Object Oriented Programming with C++
- E Balaguruswamy
http://www.cplusplus.com/reference
http://www.learncpp.com/
http://www.java2s.com/Code/Cpp/CatalogCpp.htm