Dynamic memory with pointers in c ++

0

Hello, I'm starting to use dynamic memory in C ++, but I came across a problem. When I do new CHAR_INFO[3] , say

  

can not convert 'CHAR_INFO * {aka _CHAR_INFO *}' to 'int *' in assignment

and still gives error in this line of code: new std::thread(Func) , saying

  

can not convert 'mingw_stdthread :: thread *' to 'int *' in assignment

What do these error messages mean? I can not use threads or variables of CHAR_INFO type in pointers?

EDIT1:

This is the complete code of what is giving error:

int *BUFFER = NULL;
BUFFER = new CHAR_INFO[3];
delete []BUFFER;

And also this code

int *BUFFER = NULL;
BUFFER = new std::thread(Func);
delete []BUFFER;

The function is of type void , with no arguments. If I put this separate code in a file it gives me the same error.

    
asked by anonymous 12.07.2018 / 18:49

0 answers