This presentation focus on the basic concept of pointers. so that students can easily understand. it also contains basic operations performed by pointer variables and implementation using c language.
C Programming : Arrays, One Dimensional Arrays, Two Dimensional Arrays, Three Dimensional Arrays, Operations on Arrays like Insertion, Deletion, Searching, Sorting, Merging, Traversing, Matrix Manipulation like Addition, Multiplication etc. : Visit us at : www.rozyph.com
C Programming : Arrays, One Dimensional Arrays, Two Dimensional Arrays, Three Dimensional Arrays, Operations on Arrays like Insertion, Deletion, Searching, Sorting, Merging, Traversing, Matrix Manipulation like Addition, Multiplication etc. : Visit us at : www.rozyph.com
An array is a very important derived data type in the C programming language. This presentation contains basic things about arrays like definition, initialization, their types, and examples.
An array is a very important derived data type in the C programming language. This presentation contains basic things about arrays like definition, initialization, their types, and examples.
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.
Cyber security refers to every aspect of protecting an organization and its employees and assets against cyber threats. As cyberattacks become more common and sophisticated and corporate networks grow more complex, a variety of cyber security solutions are required to mitigate corporate cyber risk.
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.
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
Computers use their memory for storing instructions of the programs and the values of the variables. Memory is a sequential collection of storage cells. Each cell has an address associated with it. Whenever we declare a variable, the system allocates, somewhere in the memory, a memory location and a unique address is assigned to this location.c pointers lecture
Pointers in C language is a variable that stores/points the address of another variable. A Pointer in C is used to allocate memory dynamically i.e. at run time.
general use of pointer
what is pointer in c language
uses is pointer in c language
representation of pointer in c language
syantax of pointer in c language
program of pointer in c language
Chart and graphs in R programming language CHANDAN KUMAR
This slide contains basics of charts and graphs in R programming language. I also focused on practical knowledge so I tried to give maximum example to understand the concepts.
The RAID stands for "Redundant Array of Inexpensive Disks" or "Redundant Array of Independent Disks") is a virtualization technology for data storage that incorporates multiple components of physical disc drives into one or more logical units for data replication, performance enhancement or both purposes.
This presentation helps to understand about RAID technology, working, types and different standard levels with their advantages and disadvantages.
In this article, different types of sorting algorithms like the bubble sort, selection sort, etc are discussed. The working method, implementation using C language, and time complexity of different algorithms are also discussed.
Searching is an extremely fascinating and useful computer science technique. It helps to find the desired object with its location and number of occurrences. The presentation includes the basic principles, algorithms and c-language implementation.
This presentation focus on the optimization problem-solving method i.e. greedy method. It also included a basic definition, components of the algorithm, effective steps, general algorithm, and applications.
This is a very important type of algorithm paradigm which is mostly used to solve any kind of problems like sorting ( merge sort, quick sort), binary search, Tower of Hanoi, etc.
loops play a vital role in any programming language, they allow the programmer to write more readable and effective code. The looping concept also allows us to reduce the number of lines.
This tutorial explains about linked List concept. it contains types of linked list also. All possible graphical representations are included for better understanding.
This tutorial helps beginners to understand, how a variety of if statements help in decision making in c programming. It also contains flow charts and illustrations to improve comprehension
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
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.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
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.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
1. 1
Prepared By:
Dr. Chandan Kumar
Assistant Professor, Computer Science & Engineering Department
Invertis University, Bareilly
2. A derived data type
A pointer is used when we want to know where the
data is stored in computer memory
Pointer variables are the special variables which are
used to store the address of other variables i.e. direct
address of the memory location
Pointer variable contains memory address as their
values
2
3. For example-
int a=15; a
3
15
110
Memory Representation
Variable_name
Variable_value
Variable_address/
Memory_location
Note: Here we showed memory representation of variable initialization i.e. int
a=15. Now from the picture, it is clear that we can access the value of a variable
with their name as well as their address also. So, if we use the address to access
variables than we use a pointer.
4. The computer memory is viewed as an array of consecutive
memory locations
Each memory location is given a unique identification
number called address
Finally, A pointer variable is a variable that can hold the
address of the other variable (same type)
For example- if we want to store the address of integer
variable than the pointer variable must be of type int.
Two pointer operators are used such as - & (address-of) and
* (De-referencing) operator
4
5. A pointer variable must be declared like other variables
before using them in a program
◦ Syntax to declare variables
data_type variable_names;
For example- int a,b;
◦ Syntax to declare pointer variable
data_type *variable_names;
For example- int *a, *b; or int* a,b;
5
6. To assign value of a variable
◦ Syntax
variable_name=value;
For example- a=20;
To assign address of a pointer variable
◦ Syntax
pointer_variable_name=&variable_name;
For example- ptr=&a;
To get value from a pointer variable
Apply * to the pointer variable i.e. *ptr
6
7. For example-
a
int a=20;
int *ptr;
ptr=&a; // i.e. address of a assign to ptr
If we print the value of ptr than we get the address of variable
‘a’.
printf(“%d”,ptr); // output will be 100
If we want to print the value of the variable whose address
stored by the pointer variable then we apply * to the pointer
variable.
printf (“%d”,*ptr); // output will be 20
7
20
100
100
ptr
8. Like other variables, pointer variables are also
initialized
◦ Syntax to initialized other variables
data_types variable_names=values;
int a=5;
int x[5]={10,20,30,40,50};
◦ Syntax to initialized pointer variable
Data_type *variable_name=&variable_name;
int *ptr=&a;
8
9. WAP to print address and value of a variable using pointer variable
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
int *ptr;
clrscr();
printf("Enter a numbern");
scanf("%d",&x);
ptr=&x;
printf("The address of x variable is %dn",ptr);
printf("The value of x variable is %d",*ptr);
getch();
}
Output:-
9
10. Hear we are going to discuss basic operation performed
by the pointers
Assignments
Arithmetic operations
◦ Addition
◦ Subtraction
Comparison
10
11. A pointer variable cab be assign the address of the other
variable. For example
int a,*ptr;
ptr=&a;
If two pointer variables are pointed to the object of
same type than they can be assign. For example
int a, *ptr1, *ptr2;
ptr1=&a;
ptr2=ptr1;
11
12. A pointer variable can be assign a null value. For
example
int *ptr;
ptr=‘0’;
Note- A pointer that is not assigned any value. If we don't
have any address to be specified in the pointer at the
time of declaration then we can assign NULL value.
int *ptr=NULL;
In most libraries, the value of the pointer is 0 (zero).
12
13. We can perform arithmetic operations on pointers.
Following are the possible arithmetic operations
◦ Addition
◦ Subtraction
13
14. When we increase a pointer by 1 the pointer begins
pointing to the next position immediately.
The pointer value would be raised by the size of the
type of data to which the pointer is pointing.
By using the addition operation on a pointer that keeps
pointing to every element of the array, performing
some operation on it, and updating itself in a loop, we
can traverse an array.
14
15. For example
int a[5]={10,11,12,13,14};
int *ptr;
Ptr=&a or &a[0];
ptr++;
or
ptr=ptr+1 Base Address
Gives address of the next element in a list
i.e. here the new address will be 102
New_address= current_address + n*size_of(data_type)
Where n is the number by which the pointer get incresed
15
Memory Representation
16. ptr=ptr+3
= &a + 3* size_of(int)
= 100+3*2
= 106
It denotes address of a[3] element in the array.
16
17. #include<stdio.h>
#include<conio.h>
int main()
{
int a[5]={10,11,12,13,14};
int *ptr;//pointer to int
clrscr();
ptr=&a[0];//stores the address of n variable
printf("Address of ptr variable is %u n",ptr);
ptr=ptr+1;
printf("After increment by 1: Address of ptr variable is %u n",ptr);
ptr=ptr+3;
printf("After increment by 3: Address of ptr variable is %u n",ptr);
getch();
return 0;
}
17
18. Output:
Here, the base address allocated by compiler is 65516.
Note: First address of the array is called base address of
the array.
18
19. We may deduct a value from the pointer variable, like
pointer addition.
An address will be given by subtracting any number
from a pointer.
The value subtraction formula from the pointer variable
is given below:
new_address= current_address - (number*size_of(data_type))
19
20. #include<stdio.h>
#include<conio.h>
void main()
{
int num=50;
int *ptr;//pointer to int
clrscr();
ptr=#//stores the address of number variable
printf("Address of ptr variable is %u n",ptr);
ptr=ptr-2; //subtracting 3 from pointer variable
printf("After subtracting 2: Address of ptr variable is %u n",ptr);
getch();
}
20
22. Pointers can be compared by the use of relational
operators like = =, <, and >. If two pointer variables are
pointing to the object of the same data type then they
can be compared with one another.
For example,
int *ptr1,*ptr2;
int x=10;
ptr1=&x;
Then we can use relational operators
if (ptr1>ptr2) and so on
22
23. The pointer reduces the code and enhances the
performance, it is used with arrays, structures, and
functions to retrieve strings, trees, etc.
Using the pointer we can return multiple values from
one method.
It lets us access any memory location in the memory of
our machine.
23
24. Many pointer implementations are in c language.
Dynamic allocation of memory
We can dynamically allocate memory in c language
using malloc) (and calloc) (functions where the pointer
is used.
Arrays, Functions and Structures
Pointers are commonly used in arrays, functions, and
structures in c language. Reduces code and improves
performance.
24
25. A normal variable stores the value whereas the pointer variable stores
the address of the variable.
The content of the C pointer always is a whole number i.e. address.
Always C pointer is initialized to null, i.e. int *p = NULL.
The value of the NULL pointer is 0.
& symbol is used to get the address of the variable.
* symbol is used to get the value of the variable that the pointer is
pointing to.
If a pointer in C is assigned to NULL, it means it is pointing to nothing.
Two pointers can be subtracted to know how many elements are
available between these two pointers.
But, Pointer addition, multiplication, division are not allowed.
The size of any pointer is 2 byte (for 16-bit compiler).
25