Dereferencing a null point when using malloc()?

Joined
Dec 27, 2024
Messages
1
Reaction score
0
Null pointer dereference error.png


Essentially, I am trying to use malloc here but the green line is letting me know I am dereferencing a null pointer here? It seems like a simple error but I don't understand why it is happening.

For context wall is a simple struct, that is a member of the PortalPanic class that looks like this:

class PortalPanic : public MinigameBase
{
public:
struct wall {
int xCord;
int yCord;
int width;
sf::Color color;
sf::RectangleShape wallRect;
};
.
.
.
more class stuff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,155
Messages
2,570,871
Members
47,401
Latest member
CliffGrime

Latest Threads

Top