In C language, I have created a program with a virtual bot so that when you start the program it introduces itself and I've given it the name Nick. When the user launches the program, it asks for the user's name and I want to write a code that if the user's name is similar to the names: Nick, Nicko, Nic, Nik or with capital letters: NICK, Nicko. Nic etc. the program will greet the user like: "Woah! I have the same name..." but when the user types another name that is not similar to Nick, the program will greet him like "Hello (user's name)...". Can you please help me? Thanks in advance!
You could create an array of cstrigns (something like char dictionary[size][size]
) and populate it with words you want to check against. Then iterate through it, checking if the input matches the current string.