The document discusses pointers in C++. It defines pointers as variables that hold the memory addresses of other variables. It describes how to declare and initialize pointers, use pointer arithmetic and operators like & and *, pass pointers as function parameters, and dynamically allocate and free memory using pointers and operators like new and delete. Pointers allow programs to write efficiently, utilize memory properly, and dynamically allocate memory as needed.
In computer science, a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
In computer science, a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its memory address. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.
This presentation is all about various built in
datastructures which we have in python.
List
Dictionary
Tuple
Set
and various methods present in each data structure
At the end of this lecture students should be able to;
Define the C pointers and its usage in computer programming.
Describe pointer declaration and initialization.
Apply C pointers for expressions.
Experiment on pointer operations.
Identify NULL pointer concept.
Experiment on pointer to pointer, pointer arrays, arrays with pointers and functions with pointers.
Apply taught concepts for writing programs.
Pointers are among C’s most powerful, yet most difficult concepts to master. Some tasks like dynamic memory allocation done only by using pointers. So it is essential to learn pointers.
Pointers are a type of variable, just like int, double, etc., except instead of storing a value, they store a memory address of another variable.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
2. Learning Outcomes
Introduction
Defining Pointer
Memory Utilization
Pointer Declaration
Pointer Arithmetic
Pointers as Function Parameters
Dynamic Allocation of Memory
2
3. Introduction
Pointers
Pointers are a powerful concept in C++ and have the
following advantages.
i. It is possible to write efficient programs.
ii. Memory is utilized properly.
iii. Dynamically allocate and de-allocate memory.
Declaration of a variable tells the compiler to perform the
following.
Allocate a location in memory. The number of location depends
on data type.
Establish relation between address of the location and the name
of the variable
3
4. Pointers
Definition:
A pointer is a variable that holds a memory address of
another variable.
The pointer has the following advantages.
Pointers save memory space.
Dynamically allocate and de-allocate memory.
Easy to deal with hardware components.
Establishes communication between program and data.
Pointers are used for file handling.
Pointers are used to create complex data structures such as
linked list, stacks, queues trees and graphs.
4
5. Pointers
Pointer Declaration:
Pointers are also variables and hence, they must be defined in a
program like any other variable.
The general syntax of pointer declaration is given below.
Syntax:
Data_Type *Ptr_Varname;
Where,
Data_Type is any valid data type supported by C++ or any user
defined type.
Ptr_Varname is the name of the pointer variable.
The presence of ‘*’ indicates that it is a pointer variable.
5
6. Pointers
Defining pointer variables:
int *iptr; iptr is declared to be a pointer variable of int type.
float *fptr; fptr is declared to be a pointer variable of float type.
char *cptr; cptr is declared to be a pointer variable of character
type.
Pointer Initialization:
Once we declare a pointer variable, we must make it to point to
something.
Initializing to the pointer the address of the variable you want to
point to as in:
iptr = #
The ‘&’ is the address operator and it represents address of the
variable 6
7. Pointers
The address of operator (&):
“&‟ is a unary operator called as ‘the address-of’
operator that returns the memory address of its
operand.
Example:
if ‘num’ is an integer variable, then ‘&num’ is its address.
Example:
int num = 25;
int *iptr;
iptr = # //The address of operator &
7
8. Pointers
Pointer Operator or Indirection Operator (*):
The second operator is indirection operator ‘*’, and it is the
complement of ‘&’.
It is a unary operator that returns the value of the variable
located at the address specified by its operand.
Example:
int num = 25;
int *iptr; //Pointer Operator (Indirection Operator *)
iptr = #
8
9. Pointers
Pointer Arithmetic:
We can perform arithmetic operations on a pointer just as you
can a numeric value.
There are four arithmetic operators that can be used on
pointers:
Increment ++
Decrement --
Addition +
Subtraction -
9
10. Pointers
Pointer Arithmetic:
The following operation can be performed on pointers.
We can add integer value to a pointer.
We can subtract an integer value from a pointer.
We can compare two pointers, if they point the elements of
the same array.
We can subtract one pointer from another pointer if both
point to the same array.
We can assign one pointer to another pointer provided both
are of same type.
10
11. Pointers
Pointer Arithmetic:
The following operations cannot be performed on
pointers.
Addition of two pointers.
Subtraction of one pointer from another pointer when they
do not point to the same array.
Multiplication of two pointers.
Division of two pointers.
11
12. Pointers
Array of Pointers:
As we have an array of integers, array of float, similarly there
can be an array of pointers.
“An array of pointer means that it is a collection of address”.
The general form of array of pointers declaration is:
int *pint[5];
The above statement declares an array of 5 pointers where each
of the pointer to integer variable.
12
13. Pointers
Pointers and Functions:
A function may be invoked in one of two ways :
Call by value
Call by reference
Function call by reference can be used in two ways :
By passing the references
By passing the pointers
Reference is an alias name for a variable.
Example:
13
int m = 23;
int &n = m;
int *p;
p = &m;
14. Pointers
Pointers as Function Parameters:
A pointer can be used as Function parameter.
It works like a reference parameter to allow change to
argument from within the function.
Example:
14
void swap(int *m, int *n)
{
int temp;
temp = *m;
*m = *n;
*n = temp;
}
void swap(&num1, & num2);
15. Pointers
Invoking Function by Passing the References:
When parameters are passed to the functions by reference, then the
formal parameters become references to the actual parameters to the
calling function.
The called function does not create its own copy of original values,
rather, it refers to the values by their references.
Example:
15
#include<iostream.h>
void main()
{
void swap(int &, int &);
int a = 10, b = 20;
cout << “n Value of a &b:” << a << b;
swap(a, b);
cout << “n After swapping a &b :” << a <<b;
}
void swap(int &m, int &n)
{
int temp;
temp = m;
m = n;
n = temp;
}
16. Pointers
Invoking Function by Passing the Pointers:
When the pointers are passed to the function, the addresses of actual
arguments in the calling function are copied into formal arguments
of the called function.
The formal arguments in the called function, can make changing the
actual arguments of the calling function..
Example:
16
#include<iostream.h>
void main()
{
void swap(int *m, int *n);
int a = 10, b = 20;
cout << “n Value of a, b :” << a << b;
swap(&a, &b);
cout << “n After swapping a, b :” << a <<b;
}
void swap(int *m, int *n)
{
int temp;
temp = *m;
*m = *n;
*n = temp;
}
17. Memory Allocation
Dynamic Allocation of Memory:
Dynamic memory allocation refers to the process of allocating
memory during the execution of the program or at run time.
Memory space allocated with this method is not fixed.
C++ supports dynamic allocation and de-allocation of objects
using:
new operators.
delete operators
These operators allocate memory for objects from a pool called
the free store.
The new operator calls the special function operator new and
delete operators call the special function operator delete.
17
18. Memory Allocation
new operator:
We can allocate storage for a variable while program is
running by using new operator.
Example:
To allocate memory for variable:
int *pnum;
pnum = new int;
The first line declares the pointer pnum.
The second line then allocates memory for an integer
To allocate memory for array:
double *dptr = new double[25];
18
19. Memory Allocation
delete Operator:
The delete operator is used to destroy the variables space
which has been created by using the new operator dynamically.
Example:
Use delete operator to free dynamic memory as:
delete iptr;
To free dynamic array memory.
delete [] dptr;
To free dynamic structure, delete structure:
delete structure;
19
20. Memory Allocation
Difference between Static and Dynamic Memory
Allocation:
20
Static Memory Allocation Dynamic Memory Allocation
Memory space is allocated before
the execution of program.
Memory space is allocated during
the execution of program.
Memory space allocated is fixed Memory space allocated is not fixed
More memory space is required. Less memory space is required.
Memory allocation from stack area. Memory space form heap area.
21. Memory Allocation
Free store (Heap memory):
Free store is a pool of memory available to allocated and de-
allocated storage for the objects during the execution of the
memory.
Memory Leak:
If the objects, that are allocated memory dynamically, are not
deleted using delete, the memory block remains occupied even
at the end of the program.
Such memory blocks are known as orphaned memory blocks.
These orphaned memory blocks when increases in number,
bring adverse effect on the system.
This situation is called memory leak
21
22. Memory Allocation
Pointers and Structures:
We can create pointers to structures variable.
struct student {int roll_no; float fee; };
student s;
student * sp = &s;
(*sp).roll_no = 14;
The above statement can be written using the operator as
Sp *roll_no = 14;
Pointers and Objects:
The Pointers pointing to objects are referred to as object
pointers. class_name * object-pointer;
Here class_name is the name of the class, object-pointer is the pointer
to an object of this class type.
22
23. Memory Allocation
this pointers:
Every object in C++ has access to its own address through an
important pointer called this pointer.
The “this pointer” is an implicit parameter to all member
functions.
Therefore, inside a member function, this may be used to refer
to the invoking object.
Example:
void main( )
{
Student *S; // Create a pointer to point Student object
S->readdata( ); // Access Student data member using a pointer
S->display( ); // Display data using a pointer
}
23