C++. Error: void is not a pointer-to-object type

前端 未结 6 1246
一生所求
一生所求 2020-12-06 04:35

I have a C++ program:

struct arguments
{
  int a, b, c;  
  arguments(): a(3), b(6), c(9) {}
};

class test_class{
  public:

    void *member_func(void *arg         


        
6条回答
  •  囚心锁ツ
    2020-12-06 05:23

    *args means "the object(value) args points to". Therefore, it can not be casted as pointer to object(argument). That's why it is giving error

提交回复
热议问题