@RMH1565 Well you would be comparing "exit\n" because we are replacing that with the NULL character \0. \0 doesn't appear as a character so we just compare "exit".
just wondering, when we use 'fgets', we often feed input via 'stdin' or a file pointer. Whats the 'stdio' that we sometimes see with typing assistance?
@unifiedreality I think it is just some weird thing Xcode does. When you #include any of the header files it autofills anyone of them. If you #include string.h it will fill in string like it does with stdio. It is only meant to be a file pointer.
Why can't I just compare with "exit\0" and leave the input string as it is?
RMH1565 1 week ago
@RMH1565 Well you would be comparing "exit\n" because we are replacing that with the NULL character \0. \0 doesn't appear as a character so we just compare "exit".
AppleProgramming 1 week ago
when is the \n actually written to get rid of? is that when we hit the enter key?
AwesomeChannel476 2 months ago
@AwesomeChannel476 Yep, fgets will tack on the \n when you hit the return key.
AppleProgramming 2 months ago
In the function RepalceReturn(char *myString) why you used '*' for character?
deepak10066 5 months ago
@deepak10066 A char* is any kind of string. So it just means you are passing in a C string.
AppleProgramming 5 months ago
Comment removed
deepak10066 5 months ago
just wondering, when we use 'fgets', we often feed input via 'stdin' or a file pointer. Whats the 'stdio' that we sometimes see with typing assistance?
unifiedreality 1 year ago
@unifiedreality I think it is just some weird thing Xcode does. When you #include any of the header files it autofills anyone of them. If you #include string.h it will fill in string like it does with stdio. It is only meant to be a file pointer.
AppleProgramming 1 year ago