I found the following code snippet in a book, and it solved my initial problem, but now I'm kinda wondering...what does it do?
[list=1][*]What does the line right after comment (1) do?[*]What does the line right after comment (2) do?[/list=1]I've tried looking it up, but I'm not having much luck seeing as I'm not real sure what to look under. To me, the line after (2) looks a lot like a parameterized constructor, but the line after (1) has me very stumped. Any ideas?PHP Code:
struct command_struct
{
string name;
bool msg;
//initializes command_struct
// (1)
command_struct(string x, bool a) : name(x), msg(a){}
};
command_struct cmdArray[] =
{
// (2)
command_struct("say", true),
command_struct("NULL", false)
};