I'm currently trying to make a small 'Virtual Assistant' in C; very basic. But I'm encountering a couple errors which outputs error: incompatible types when assigning to type 'char[550]' from type 'char *';
or something like that.
Here is my code:
int main()
{
char userName[35];
char qInput[550];
printf("Hi! What's your name?\n\a");
scanf("%s", userName);
printf("\nHello, %s! My name is EDI. I'm a friendly piece of AI you can talk to!\n\n\a", userName);
printf("\nWhat would you like to ask me? Please keep in mind to use proper spelling \nor I won't understand the question.\n\a");
scanf("%s", qInput);
//what's your name?
if(qInput = "What's your name"){
printf("My name is EDI!");
scanf("%s", qInput);
} else if(qInput = "What's your name?"){
printf("My name is EDI");
scanf("%s", qInput);
} else if(qInput = "Whats your name?"){
printf("My name is EDI");
scanf("%s", qInput);
} else if(qInput = "What's your name"){
printf("My name is EDI");
scanf("%s", qInput);
//age
} else if(qInput = "How old are you?"){
printf("I was born like eight minutes ago...");
scanf("%s", qInput);
} else if(qInput = "How old are you"){
printf("I was born like eight minutes ago...");
scanf("%s", qInput);
} else if(qInput = "What is your age?"){
printf("Eight or so minutes old.. Give or take");
scanf("%s", qInput);
} else if(qInput = "What is your age"){
printf("Eight or so minutes old.. Give or take");
scanf("%s", qInput);
}
}
Please help me out! I am very new to C and would like to keep learning new things and new techniques. What can I change to make this work the way it should? I'm experienced with php, so I understand the if / else side of things..
Thanks!