+ 1
How to make Dot function in c++?
I see things like str.replace(5,2,”hi”); But I don’t understand how the function was made if it’s not a class? Anyone know how?
2 Antworten
+ 1
If a function is not a member of a class or struct, then you can invoke it directly by its name (and arguments - as necessary) without any need of the "dot".
The "dot" is also known as member access operator
https://en.cppreference.com/w/cpp/language/operator_precedence