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.

Recommended Answers

All 3 Replies

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.

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.

>>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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.