How do I print a forward slash (/ or \) in C?
I know this is a very stupid and simple question, but I was trying to print an image of a robot that should output this:
+----------+
| |
| /\ /\ |
| \/ \/ |
| |
| [-=-=-] |
+----------+
The part I'm stuck on is printing eyes. originally I coded:
printf("| /\ /\ |");
printf("| \/ \/ |");
but the error was shown, so I remembered that you need to do the double slash like so:
printf("| \/\\ \/\\ |");
printf("| \\\/ \\\/ |");
but an error indicating that the implicit printf function declaration is showing even after that ?! I don't understand the error. Can someone please explain how to fix this?
+3
source to share