Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Oct 10, 2000

Invoking a Function Through a Pointer

When you call a function through a pointer to function, use that pointer as if it were the function itself, not a pointer. For example:

 
#include <cstring>
char buff[10];
void (*pf) (char *, const char *);
pf = strcpy; // take address of strcpy
pf(buff, "hi"); // use pf as if it were the function itself
Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap