0

can I call a function B outside a class (say, a global function) from a member function Aof that class? if so, how do I specify the scope? Using :: B ?

thanks.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by firstPerson
0

can I call a function B outside a class (say, a global function) from a member function Aof that class? if so, how do I specify the scope? Using :: B ?

thanks.

If B() is truly global, you call it like this ( brace yourself ) B() . And the best part is, you can call it like this from anywhere, including inside of a class function, because it is global.

0

If B() is truly global, you call it like this ( brace yourself ) B() . And the best part is, you can call it like this from anywhere, including inside of a class function, because it is global.

thanks much.

0

>>And the best part is, you can call it like this from anywhere, including inside of a class function, because it is global

That's not the best part, in fact, that's the worst part!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.