SetUserData from Box2D libary, resulting in Exception thrown at 0x010110077

0

I am new to Box2D, and I wanted to create a body that would SetUserData of 2 different players but it results in "Exception thrown at 0x01011007 in ConsoleApplication1.exe: 0xC0000005: Access violation writing location 0x00000094."

I already tried to do player_body[0]->SetUserData("player1"); but it says cannot convert from const char to void*

b2Body* player_body[2]; 
player_body[0]->SetUserData((void*)"player1");
player_body[1]->SetUserData((void*)"player2");
c++
box2d
sfml
asked on Stack Overflow Jul 8, 2019 by Rushab Roihan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0