c++ - What is the difference between the dot (. ) operator and . . . foo->bar() is the same as (*foo) bar() The parenthesizes above are necessary because of the binding strength of the * and operators *foo bar() wouldn't work because Dot ( ) operator is evaluated first (see operator precedence) The Dot ( ) operator can't be overloaded, arrow (->) operator can be overloaded The Dot ( ) operator can't be applied to pointers Also see: What is the arrow
C++ code file extension? What is the difference between . cc and . cpp 95 cpp is the recommended extension for C++ as far as I know Some people even recommend using hpp for C++ headers, just to differentiate from C Although the compiler doesn't care what you do, it's personal preference
What is the meaning of prepended double colon - Stack Overflow I found this line of a code in a class which I have to modify: ::Configuration * tmpCo = m_configurationDB; pointer to current db and I don't know what exactly means the double colon prepended to
How can I call functions from one . cpp file in another . cpp file? The result will be an object file for each unit Note that some code (like in main cpp) refers to another code (class cpp) This will be resolved in the next step Link the translation units altogether into an executable file (See JMAA 's answer for more details) Applying step 1 above, we will have two translation units ( cpp files): File
. c vs . cc vs. . cpp vs . hpp vs . h vs . cxx - Stack Overflow Possible Duplicates: * h or * hpp for your class definitions What is the difference between cc and cpp file suffix? I used to think that it used to be that: h files are header files for C and C
Using G++ to compile multiple . cpp and . h files - Stack Overflow I know this question has been asked years ago but still wanted to share how I usually compile multiple c++ files Let's say you have 5 cpp files, all you have to do is use the * instead of typing each cpp files name E g g++ -c * cpp -o myprogram This will generate "myprogram" run the program myprogram that's all!! The reason I'm using * is that what if you have 30 cpp files would you type