Hello, I've watched this tutorial some time now, I've copied the whole code.
just some variable name and such that are different.
I'm using Code::blocks.
The errors I'm receiving are :
C:\Program Files (x86)\CodeBlocks\projekt\class\main.cpp||In function 'int main()':|
C:\Program Files (x86)\CodeBlocks\projekt\class\main.cpp|28|error: invalid conversion from 'volatile void*' to 'void*'|
C:\Program Files (x86)\CodeBlocks\projekt\class\main.cpp|28|error: initializing argument 3 of 'long unsigned int _beginthread(void (*)(void*), unsigned int, void*)'|
||=== Build finished: 2 errors, 0 warnings ===|
The code are down below.
I saw in the old post that volatile where in the wrong place so I placed it right before uhm... Making an instance(?) with it.
using namespace std;
void main2(void *pParam)
mitt *pmitt = (mitt*)pParam;
for(int j=0; j<pmitt->antal; j++)
cout << "Thread #2: " << j << "n";
pmitt->done = true;
volatile mitt var;
var.done = false;
var.antal = 10;
_beginthread(main2, 0 , &var);
for(int i=0; i<9; i++)
cout << i << "\n";
cout << "Thread #2 is done!";
I would also like to thank you for those tutorials.
I have been struggling with inheritance for a long time but seeing your video tutorial made everything crystal.
Have a nice evening!