Heh, I've noticed that a lot of people have been cracking down on saying "C/C++" lately, especially at StackOverflow. They've got a point too: the languages are almost nothing alike anymore. I can't even decipher C++11 code half of the time, so I've all but given up on keeping up with the language in favor of writing C code if I absolutely must code in a compiled language, or older style C++ if I think I need OOP. That basically amounts to manual memory management rather than smart pointers, STL containers and strings and very, very rare usage of templates. I really should learn smart pointers...
Anyway, I'm not very experienced with C# as I've only fooled around with it a time or two, but I think your function should look closer to this:
public bool AddActorToList(Actor p_cNewActor)
{
// Run through the list looking for an empty slot
int i = 0;
for (i = 0; i < GlobalVar.MAX_ACTORS; i++)
{
// Is this empty?
if (actorlist.p_cActorList[i] == null)
{
// If so, use it!
actorlist.p_cActorList[i] = p_cNewActor;
// Finished! Report success
return true;
}
}
// Couldn't find a free slot. Report failure.
return false;
}
Your function's prototype was using [] notation, which means it was expecting an array of actors, but you wanted to only pass one to it. I also fixed up actorlist.p_cActorList to use [] notation inside your loop, since it was trying to reassign the entire array instead of just one element of it. Hopefully my brief scanning of it didn't completely miss the point of the function.