The following snippet encompasses lines 4-56 in my code:
Code:
record tmpKnowledgeBase[] = {
{"REPETITION T1**"},
LINK_SPECIAL,
{
"Why are you repeating yourself?",
"I heard you the first time.",
"This conversation is starting to bore me.",
"Don't you have anything else to say?"
},
{"REPETITION T2**"},
LINK_SPECIAL,
{
"Yes, I know. You already said that.",
"Didn't you already say that?",
"I'm getting the impression you're repeating yourself."
},
{"BOT DONT UNDERSTAND**"},
LINK_SPECIAL,
{
"What are you talking about?.",
"I'm not sure I understand what you mean...",
"Huh?"
},
{"NULL INPUT**"},
LINK_SPECIAL,
{
"What the heck is that supposed to mean?",
"At least take the time to say SOMETHING.",
"Talking requires TWO people, you know."
},
{"NULL INPUT REPETITION**"},
LINK_SPECIAL,
{
"...",
"Wow, that's really annoying. Stop it.",
"What's wrong with you?",
"This isn't funny - it's just stupid."
},
{"HELLO", "HI"},
LINK_OR,
{
"Hey there!",
"Hello.",
"Hiya!"
},
{"WHAT", "YOUR", "NAME"},
LINK_AND,
{
"My name is "+botName+"!",
"Does it really matter?",
botName+", at your service."
}
};
Here are the declarations for structs record and keywords:
Code:
typedef struct {
std::string keyset[TURNERBOT_MAX_KEYWORDS];
int linkType;
} keywords;
typedef struct {
keywords keys;
std::string response[TURNERBOT_MAX_RESP];
} record;
Now, this looks fine to ME, but... I'm not that great a C++. I'm getting the following error when I try to compile:
Code:
/home/shane/TurnerBot/src/bot.cpp: In member function 'void TurnerBot::generateKnowledgeBase()':
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'int'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'int'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'int'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
/home/shane/TurnerBot/src/bot.cpp:56: error: braces around scalar initializer for type 'std::string'
Can somebody please tell me what this is talking about and how I can fix it? =/