I'm really new to c++. I have a simple console application with an header.h
that holds my class
class MyClass
{
public:
float x, y, z;
MyClass(float x, float y, float z);
};
I have a implement.cpp
with all my implemented methods and I have
MyClass::MyClass(float x, float y, float z) {};
Then in main.cpp
I try to simply print the values
int main()
{
MyClass One(-3.0f, 0.0f, 4.0f);
cout << "Firsth Object: " << One.x << ", " << One.y << ", " << One.z << endl;
}
But in console values are printed like :
-1.07374e+08, -1.07374e+08, -1.07374e+08
What am I doing wrong?