Default constructor not being called c++ OOP

后端 未结 1 1259
小鲜肉
小鲜肉 2021-01-24 23:58

So I\'m making a program in c++ to handle vectors, and it\'s mostly there, but I just wanted to test it, so I have this:

class vector3 {
    protected: 
               


        
1条回答
  •  -上瘾入骨i
    2021-01-25 00:39

    vector3 vec1();
    

    You're declaring a function here, and displaying a function pointer. Use:

    vector3 vec1;
    

    0 讨论(0)
提交回复
热议问题