use a class methode withouth a instance
is it possibble to use a class methode without making a instance, something like this: https://code.sololearn.com/cbbe6QJSzd6P/?ref=app
Namespaces are there to prevent the collision of names. For example the standard library has class vector inside the std namespace. If you use another library like a graphic library, it isn't uncommon that there is another class called vector ( the math version ) in its own namespace. Without the namespaces your compiler wouldn't be able to tell which one you want to use. So they prevent ambiguity issues. So having a class just with static functions probably isn't a better alternative than a namespace.
Yes, just use myClass::hi() instead of myClass.hi() if the function is static. ( and move the class above main )
Dennis it now works but what does the "::" mean, i know it i used for namesspaces but i dont really know much about those either
Dennis aren't namespaces and static classes then basicly the same thing?
Pretty much, yea. Except that they can be private in a class.
Dennis oh yeah, but then what are namespaces used for?
Dennis thabk you, i now understand it