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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: C++
Expertise: Intermediate
Sep 15, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


The standard functions isalpha(), isdigit(), isprint() etc., defined in the stan

The .* and ->* operators enable you to call a member function without having to know the function's name. Remember, however, that when using these operators, you have to parenthesize the expression as follows:

 
A a; // create object
void (A::*pmf)() = &A::f; // create pointer to member

// the two pairs of parentheses are needed here:
(a.*pmf)(); // call A::f() thorough pointer to member

Omitting the first pair of parentheses, as in the following example, is a common mistake:

 
a.*pmf(); // error, missing parentheses

Although some compilers might accept it, this is not the correct C++ syntax. Always use two pairs of parentheses when calling a member function through either .* or ->*.

Danny Kalev
 
Comment and Contribute

 

 

 

 

 


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

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date