Thanks for the tips with the strcpy and strcmp functions. I got the below working to some limited extent. How would I go about converting the user input to lowercase (i.e. if they enter john instead of John it obviously won't work). Also how do you generate a random number in C?
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char name[100];
char name2[100];
printf("Please enter you're name \n");
printf(">>>");
scanf("%s", name);
if (strcmp (name, "John") == 0){
strcpy (name2, "George W. Bush");
}
else if (strcmp (name, "Doogie") == 0){
strcpy (name2, "Clifford the big red dog");
}
else
(strcpy (name2, name));
for (i = 0; i < 10; i++){
printf("Don't be an EMO %s! \n", name2);
}
return 0;
}