3

I have tried:

int** thread_args = malloc(24);

and

int** thread_args = malloc(sizeof(int*) * 3);

but I keep getting the error message.

I would really appreciate your help!

CottonCandy
  • 444
  • 2
  • 5
  • 15

1 Answers1

10

If you use C++ compiler, you may need to cast the result of malloc:

int ** th_args = (int**)malloc(24)

or simply use operator new.

If you use a C compiler, then... I am not sure of why this error is thrown

PhoenixBlue
  • 967
  • 2
  • 9
  • 26
  • 1
    I'm pretty sure you're supposed to use `static_cast<>` in C++ (or an existing container type, really). – melpomene Sep 17 '18 at 07:48