What is the best way to indicate that a double value has not been initialized?

前端 未结 9 1922
萌比男神i
萌比男神i 2020-12-22 06:26

I have a class CS which is to represent the co-ordinate system in 3D i.e.(x, y, z)

class CS
{
  private:
        double x;
        double y;
        double z         


        
9条回答
  •  南方客
    南方客 (楼主)
    2020-12-22 07:06

    You can't change the address of a variable. And you can't assign pointer values (like NULL, or nullptr in C++) to a variable of a non-pointer type, such as double.

提交回复
热议问题