Class Function?
-
Why is it required to place a scope resolution operator when writing code out for class functions, and why does it cause a syntax error? Loli10
it's necessary because that's how the compiler knows which class to attach the code to, so to speak. without it, you'd need to have unique names for every function in every class - which makes inheritance pretty much impossible. -c
Civilization is the limitless multiplication of unnecessary necessities. Mark Twain
-
Why is it required to place a scope resolution operator when writing code out for class functions, and why does it cause a syntax error? Loli10
As Chris has already said, it lets the compiler associate a function's implementation with a class. My point is that you can separate a large class (i.e. one with many functions) into different files. Also (not recommended), the same .cpp file can contain functions of more than one class. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com
-
As Chris has already said, it lets the compiler associate a function's implementation with a class. My point is that you can separate a large class (i.e. one with many functions) into different files. Also (not recommended), the same .cpp file can contain functions of more than one class. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com