+ 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 Answers
+ 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