Increase your font size. They look like : to me.
Quzah.
Printable View
I absolutely don’t have clue what the colon you’re talking about! I asked you question and you give some random :-/
ssharish
The quote tags put the text in italics. With a smaller font size, the regular colon ( : ) looks like a semi-colon ( ; ), hence Tater's confusion.
My guess is that he's assuming name will have whitespace.
Quzah.
Mate it wont work! Have you compiling your suggesting before posting?
ssharish
It's not going to work because %s will happily read the : as part of the string, leading to Very Bad Things, is where we're going here I think.
Even ssharish2005's code will lead to buffer overruns if the input is not formatted correctly and all the string part buffers are not 104 characters or longer. You really do need width fields for anything with %s or %[].
No, even then you need %N[], with N limmited by the size of the target buffer, or else you can buffer overflow. If you're using fgets followed by sscanf, you can make all your buffers the max line length, but otherwise you need the width specifier. The advantage to the no width specifier method is you don't have a magic number as a string literal.