This may seem like a simple question but i am getting an error when compiling this. I want to be able to pass an enum into a method in C.
Enum
enum TYPES { PHOTON, NEUTRINO, QUARK, PROTON, ELECTRON };
Calling the method
makeParticle(PHOTON, 0.3f, 0.09f, location, colour);
Method
struct Particle makeParticle(enum TYPES type, float radius, float speed, struct Vector3 location, struct Vector3 colour)
{
struct Particle p;
p.type = type;
p.radius = radius;
p.speed = speed;
p.location = location;
p.colour = colour;
return p;
}
The error I am getting is when I am calling the method:
incompatible types in assignment
here's a copy of my code http://pastebin.com/m253b4ebc