is there any similiarities betweenandCode:std::cout
since Car is a class, is std a predefined class too?Code:int Car::GetYear()
another question.
if Car is a class and GetYear is a accessor function why do we use the :: ?
Printable View
is there any similiarities betweenandCode:std::cout
since Car is a class, is std a predefined class too?Code:int Car::GetYear()
another question.
if Car is a class and GetYear is a accessor function why do we use the :: ?
std is a namespace. They're like libraries or packages in java. Its a group of classes, data, functions, and definitions.
The :: is the scope resolution operator. You need to use it to tell the compiler that the thing on the right belongs in the thing on the left.
ah cool :)