I'm just looking for some quick info to wrap my brain around how this is supposed to work. For a program for school I need to use the getchar() function to run through an array of chars and perform some tasks, but it also needs to be checking for some things like a "-1" to end the program and "\n" to force a new line for example. My question is how can I check for a -1 or \n if it's an array of chars? When I have my program try to check for those it just spits out errors about it being more than a single character, which is what I would have expected, yet the program specs spell out that's how it needs to work...
The only thing I can think is to create two steps, basically if you encounter a - or a \, check the next character for a 1 or n. Is that what I probably need to do, or is there actually a way to fit -1 and \n in to single char elements in an array of chars?
Thanks in advance for any info =)