SlideShare a Scribd company logo
1 of 10
Pointers to functions
09/04/131 VIT - SCSE
Functions to be referenced by a pointer
return_type (*variable)(list of parameters);
for example,
float (*p)(float,float,float);
p=&average;
09/04/132 VIT - SCSE
#include<iostream.h>
#include<conio.h>
void main()
{
float average(float x,float y, float z);
float a,b,c,avg;
float (*p)(float x,float y,floatz);
p=&average;
cout<<”Enter three numbers”;
cin>>a>>b>>c;
avg=(*p)(a,b,c);
cout<<”Average=”<<avg;
getch();
}
float average(float x,float
y,floatz)
{
float temp;
temp=(x+y+z)/3.0;
return(temp);
}
Pointers and Arrays
09/04/133 VIT - SCSE
int value[5]={2,5,1,6,3};
int *p;
p=value; (take the address of 0th
location)
//p=&value[2]; (ok)
cout<<p;
cout<<*p;
Arrays of Pointers
09/04/134 VIT - SCSE
Int *p[3];
i.e p[0], p[1], p[2]
int a=4;
int b=6;
int c=2;
int *p[3];
p[0]=&a;
p[1]=&b;
p[2]=&c;
cout<<*p[0];
cout<<*p[1];
cout<<*p[2];
cout<<p[0];
cout<<p[1];
cout<<p[2];
Pointers to Pointers
09/04/135 VIT - SCSE
Int a;
Int *p;
Int **q;
09/04/136 VIT - SCSE
#include<iostream.h>
void main()
{
int value;
int *p;
int **q;
value=100;
cout<<”value=”<<value<<endl;
p=&value;
q=&p;
cout<<”Pointer 1=”<<*p<<endl;
cout<<”Pointer 2=”<<**q<<endl;
}
Scope Resolution Operator
::variablename;
09/04/137 VIT - SCSE
#include<iostream.h>
int m=10; //global
int main()
{
int m=20; //local to main
{ int k=m;
int m=30;
cout<<”we are in inner block”<<endl;
cout<<”k=”<<k<<endl;
cout<<”m=”<<m<<endl;
cout<<”::m=”<<::m<<endl;
} return 0;
}
Standard Template Library (STL
09/04/138 VIT - SCSE
It is a software library partially included in the C++ Standard
Library.
It provides containers, iterators, algorithms, and functors.
More specifically, the C++ Standard Library is based on the
STL published by SGI.
 
(Silicon Graphics Computer Systems or SGCS) was a
manufacturer of high-performance computing solutions,
including computer hardware and software, founded in 1981
by Jim Clark and Abbey Silverstone.
09/04/139 VIT - SCSE
C++ Standard Library 
ios
iostream
iomanip
fstream
sstream
Standard Template Library
vector
deque
list
map
set
stack
Queue
Vector is a class template in the C++ Standard Template
Library, which functions like a dynamic array.
09/04/139 VIT - SCSE
C++ Standard Library
ios
iostream
iomanip
fstream
sstream
Standard Template Library
vector
deque
list
map
set
stack
Queue
Vector is a class template in the C++ Standard Template
Library, which functions like a dynamic array.

More Related Content

What's hot

GeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetGeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetJose Perez
 
Applications of list
Applications of listApplications of list
Applications of listElavarasi K
 
Code sources des fonctions table cp
Code sources des fonctions table cpCode sources des fonctions table cp
Code sources des fonctions table cpidhem110
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Dr. Loganathan R
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Arduino light tracking code with 4 stepper motors
Arduino light tracking code with 4 stepper motorsArduino light tracking code with 4 stepper motors
Arduino light tracking code with 4 stepper motorsJeff Apol
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptkinan keshkeh
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Dr. Loganathan R
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Sylvain Hallé
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examplesmua99
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervosoLuis Vendrame
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to PerlSway Wang
 

What's hot (18)

GeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetGeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheet
 
Applications of list
Applications of listApplications of list
Applications of list
 
Pointers in C and Dynamic Memory Allocation
Pointers in C and Dynamic Memory AllocationPointers in C and Dynamic Memory Allocation
Pointers in C and Dynamic Memory Allocation
 
StewartPlatform_cpp
StewartPlatform_cppStewartPlatform_cpp
StewartPlatform_cpp
 
Code sources des fonctions table cp
Code sources des fonctions table cpCode sources des fonctions table cp
Code sources des fonctions table cp
 
Tu1
Tu1Tu1
Tu1
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
test
testtest
test
 
Arduino light tracking code with 4 stepper motors
Arduino light tracking code with 4 stepper motorsArduino light tracking code with 4 stepper motors
Arduino light tracking code with 4 stepper motors
 
Shapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop conceptShapes and calculate (area and contour) / C++ oop concept
Shapes and calculate (area and contour) / C++ oop concept
 
File Handling Program
File Handling ProgramFile Handling Program
File Handling Program
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
 
Compiling fµn language
Compiling fµn languageCompiling fµn language
Compiling fµn language
 
Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings Activity Recognition Through Complex Event Processing: First Findings
Activity Recognition Through Complex Event Processing: First Findings
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
Introduction to Perl
Introduction to PerlIntroduction to Perl
Introduction to Perl
 

Viewers also liked

Viewers also liked (6)

Advanced+pointers
Advanced+pointersAdvanced+pointers
Advanced+pointers
 
9. pointer, pointer & function
9. pointer, pointer & function9. pointer, pointer & function
9. pointer, pointer & function
 
Data structure lecture 1
Data structure   lecture 1Data structure   lecture 1
Data structure lecture 1
 
Pointers in C
Pointers in CPointers in C
Pointers in C
 
C pointer
C pointerC pointer
C pointer
 
C Pointers
C PointersC Pointers
C Pointers
 

Similar to 6 pointers functions

4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functionsDocent Education
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxhappycocoman
 
Add a function prototype for the function sumNum- # include using nam.docx
Add a function prototype for the function sumNum- # include  using nam.docxAdd a function prototype for the function sumNum- # include  using nam.docx
Add a function prototype for the function sumNum- # include using nam.docxwviola
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Ismar Silveira
 
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov
 
presentation_pointers_1444076066_140676 (1).ppt
presentation_pointers_1444076066_140676 (1).pptpresentation_pointers_1444076066_140676 (1).ppt
presentation_pointers_1444076066_140676 (1).pptgeorgejustymirobi1
 
4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statementsMomenMostafa
 
Pointers and Dynamic Memory Allocation
Pointers and Dynamic Memory AllocationPointers and Dynamic Memory Allocation
Pointers and Dynamic Memory AllocationRabin BK
 
Chapter09-10 Pointers and operations .PPT
Chapter09-10  Pointers and operations .PPTChapter09-10  Pointers and operations .PPT
Chapter09-10 Pointers and operations .PPTShalabhMishra10
 
Presentation on pointers
Presentation on pointersPresentation on pointers
Presentation on pointersBhimsen Joshi
 

Similar to 6 pointers functions (20)

4 Type conversion functions
4 Type conversion functions4 Type conversion functions
4 Type conversion functions
 
U3.pptx
U3.pptxU3.pptx
U3.pptx
 
unit 3 ppt.pptx
unit 3 ppt.pptxunit 3 ppt.pptx
unit 3 ppt.pptx
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptx
 
4. chapter iii
4. chapter iii4. chapter iii
4. chapter iii
 
Add a function prototype for the function sumNum- # include using nam.docx
Add a function prototype for the function sumNum- # include  using nam.docxAdd a function prototype for the function sumNum- # include  using nam.docx
Add a function prototype for the function sumNum- # include using nam.docx
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
 
presentation_pointers_1444076066_140676 (1).ppt
presentation_pointers_1444076066_140676 (1).pptpresentation_pointers_1444076066_140676 (1).ppt
presentation_pointers_1444076066_140676 (1).ppt
 
c program.ppt
c program.pptc program.ppt
c program.ppt
 
Blocks+gcd入門
Blocks+gcd入門Blocks+gcd入門
Blocks+gcd入門
 
4 operators, expressions &amp; statements
4  operators, expressions &amp; statements4  operators, expressions &amp; statements
4 operators, expressions &amp; statements
 
CHAPTER 5
CHAPTER 5CHAPTER 5
CHAPTER 5
 
Pointers and Dynamic Memory Allocation
Pointers and Dynamic Memory AllocationPointers and Dynamic Memory Allocation
Pointers and Dynamic Memory Allocation
 
C++11
C++11C++11
C++11
 
Chapter09-10.PPT
Chapter09-10.PPTChapter09-10.PPT
Chapter09-10.PPT
 
Chapter09-10 Pointers and operations .PPT
Chapter09-10  Pointers and operations .PPTChapter09-10  Pointers and operations .PPT
Chapter09-10 Pointers and operations .PPT
 
Presentation on pointers
Presentation on pointersPresentation on pointers
Presentation on pointers
 
Pointers [compatibility mode]
Pointers [compatibility mode]Pointers [compatibility mode]
Pointers [compatibility mode]
 
Lk module5 pointers
Lk module5 pointersLk module5 pointers
Lk module5 pointers
 

More from Docent Education

More from Docent Education (14)

17 files and streams
17 files and streams17 files and streams
17 files and streams
 
16 virtual function
16 virtual function16 virtual function
16 virtual function
 
14 operator overloading
14 operator overloading14 operator overloading
14 operator overloading
 
13 exception handling
13 exception handling13 exception handling
13 exception handling
 
12 constructors invocation and data members initialization
12 constructors invocation and data members initialization12 constructors invocation and data members initialization
12 constructors invocation and data members initialization
 
12 constructors invocation and data members initialization
12 constructors invocation and data members initialization12 constructors invocation and data members initialization
12 constructors invocation and data members initialization
 
11 constructors in derived classes
11 constructors in derived classes11 constructors in derived classes
11 constructors in derived classes
 
10 inheritance
10 inheritance10 inheritance
10 inheritance
 
7 class objects
7 class objects7 class objects
7 class objects
 
5 array
5 array5 array
5 array
 
1 Intro Object Oriented Programming
1  Intro Object Oriented Programming1  Intro Object Oriented Programming
1 Intro Object Oriented Programming
 
3 intro basic_elements
3 intro basic_elements3 intro basic_elements
3 intro basic_elements
 
2 Intro c++
2 Intro c++2 Intro c++
2 Intro c++
 
unit-1-intro
 unit-1-intro unit-1-intro
unit-1-intro
 

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

6 pointers functions

  • 1. Pointers to functions 09/04/131 VIT - SCSE Functions to be referenced by a pointer return_type (*variable)(list of parameters); for example, float (*p)(float,float,float); p=&average;
  • 2. 09/04/132 VIT - SCSE #include<iostream.h> #include<conio.h> void main() { float average(float x,float y, float z); float a,b,c,avg; float (*p)(float x,float y,floatz); p=&average; cout<<”Enter three numbers”; cin>>a>>b>>c; avg=(*p)(a,b,c); cout<<”Average=”<<avg; getch(); } float average(float x,float y,floatz) { float temp; temp=(x+y+z)/3.0; return(temp); }
  • 3. Pointers and Arrays 09/04/133 VIT - SCSE int value[5]={2,5,1,6,3}; int *p; p=value; (take the address of 0th location) //p=&value[2]; (ok) cout<<p; cout<<*p;
  • 4. Arrays of Pointers 09/04/134 VIT - SCSE Int *p[3]; i.e p[0], p[1], p[2] int a=4; int b=6; int c=2; int *p[3]; p[0]=&a; p[1]=&b; p[2]=&c; cout<<*p[0]; cout<<*p[1]; cout<<*p[2]; cout<<p[0]; cout<<p[1]; cout<<p[2];
  • 5. Pointers to Pointers 09/04/135 VIT - SCSE Int a; Int *p; Int **q;
  • 6. 09/04/136 VIT - SCSE #include<iostream.h> void main() { int value; int *p; int **q; value=100; cout<<”value=”<<value<<endl; p=&value; q=&p; cout<<”Pointer 1=”<<*p<<endl; cout<<”Pointer 2=”<<**q<<endl; }
  • 7. Scope Resolution Operator ::variablename; 09/04/137 VIT - SCSE #include<iostream.h> int m=10; //global int main() { int m=20; //local to main { int k=m; int m=30; cout<<”we are in inner block”<<endl; cout<<”k=”<<k<<endl; cout<<”m=”<<m<<endl; cout<<”::m=”<<::m<<endl; } return 0; }
  • 8. Standard Template Library (STL 09/04/138 VIT - SCSE It is a software library partially included in the C++ Standard Library. It provides containers, iterators, algorithms, and functors. More specifically, the C++ Standard Library is based on the STL published by SGI.   (Silicon Graphics Computer Systems or SGCS) was a manufacturer of high-performance computing solutions, including computer hardware and software, founded in 1981 by Jim Clark and Abbey Silverstone.
  • 9. 09/04/139 VIT - SCSE C++ Standard Library  ios iostream iomanip fstream sstream Standard Template Library vector deque list map set stack Queue Vector is a class template in the C++ Standard Template Library, which functions like a dynamic array.
  • 10. 09/04/139 VIT - SCSE C++ Standard Library ios iostream iomanip fstream sstream Standard Template Library vector deque list map set stack Queue Vector is a class template in the C++ Standard Template Library, which functions like a dynamic array.