Added: 1 year ago
From: AppleProgramming
Views: 1,410
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (9)

Sign In or Sign Up now to post a comment!
  • Why can't I just compare with "exit\0" and leave the input string as it is?

  • @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".

  • when is the \n actually written to get rid of? is that when we hit the enter key?

  • @AwesomeChannel476 Yep, fgets will tack on the \n when you hit the return key.

  • In the function RepalceReturn(char *myString) why you used '*' for character?

  • @deepak10066 A char* is any kind of string. So it just means you are passing in a C string.

  • Comment removed

  • 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.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more