Total members 11895 |It is currently Sun Dec 22, 2024 6:12 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Types of Pointers in C++
Pointers Varieties
********************************************************************************\
*****************

(1)
Code:
int *p;

// p is a pointer to an integer quantity

(2)
Code:
int *p[10];

// p is a 10-element array of pointers to integer quantities

(3)
Code:
int (*p)[10];

// p is a pointer to a 10-element integer array

(4)
Code:
int *p(void);

// p is a function that returns a pointer to an integer quantity

(5)
Code:
int p(char *a);

// p is a function that accepts an argument which is a pointer to a
character returns an
// integer quantity

(6)
Code:
int *p(char *a);

// p is a function that accepts an argument which is a pointer to a
character returns a
// pointer to an integer quantity

(7)
Code:
int (*p)(char *a);

// p is pointer to a function that accepts an argument which is a pointer to
a character
// returns an integer quantity

(8)
Code:
int (*p(char *a))[10];

// p is a function that accepts an argument which is a pointer to a
character returns a
// pointer to a 10-element integer array

(9)
Code:
int p(char (*a)[]);

// p is a function that accepts an argument which is a pointer to a
character array returns
// an integer quantity

(10)
Code:
int p(char *a[]);

// p is a function that accepts an argument which is a array of pointers to
characters
// returns an integer quantity

(11)
Code:
int *p(char a[]);

// p is a function that accepts an argument which is a character array
returns a pointer to
// to an integer quantity

(12)
Code:
int *p(char (*a)[]);

// p is a function that accepts an argument which is a pointer to a
character array returns a
// pointer to an integer quantity

(13)
Code:
int *p(char *a[]);

// p is a function that accepts an argument which is an array of pointers to
characters
// returns a pointer to an integer quantity

(14)
Code:
int (*p)(char (*a)[]);

// p is pointer to a function that accepts an argument which is a pointer to
a character array
// returns an integer quantity

(15)
Code:
int *(*p)(char (*a)[]);

// p is pointer to a function that accepts an argument which is a pointer to
a character array
// returns a pointer to an integer quantity

(16)
Code:
int *(*p)(char *a[]);

// p is pointer to a function that accepts an argument which is a array of
pointers to
// characters returns a pointer to an integer quantity

(17)
Code:
int (*p[10])(void);

// p is 10-element array of pointers to functions; each function returns an
integer quantity

(18)
Code:
int (*p[10])(char a);

// p is 10-element array of pointers to functions; each function accepts an
argument which is
// a character and returns an integer quantity

(19)
Code:
int *(*p[10])(char a);

// p is 10-element array of pointers to functions; each function accepts an
argument which is
// a character and returns a pointer to an integer quantity

(20)
Code:
int *(*p[10])(char *a);

// p is 10-element array of pointers to functions; each function accepts an
argument which is
// a pointer to a character and returns a pointer to an integer quantity

:wink:



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Types of Pointers in C++
 pointers to derived types     -  
 Arrays using Pointers     -  
 How to use pointers and what it means     -  
 Basic Pointers     -  
 Swap Using Pointers     -  
 Passing Pointers to function example     -  
 The using of pointers between two variables (Swaping)     -  
 References confuse me. How do they differ from pointers?     -  
 Types of Registers     -  
 java data types     -  



Topic Tags

C++ Variables, C++ Basics
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com