The following line will start reading a number (%d
) followed by anything different from tabs or newlines (%[^\t\n]
).
sscanf("19 cool kid", "%d %[^\t\n]", &age, buffer);
More Related Contents:
- isnt everything where it should be, why the segmentation fault?
- ‘ ‘, ‘\n’ , scanf() and output screen
- How do you allow spaces to be entered using scanf?
- How to use sscanf in loops?
- When should I use ampersand with scanf()
- Reading string from input with space character? [duplicate]
- How to read string from keyboard using C?
- Read no more than size of string with scanf()
- Why doesn’t scanf need an ampersand for strings and also works fine in printf (in C)?
- Why is adding a leading space in a scanf format string recommended?
- Strange character after an array of characters
- String termination C/C++ char = 0
- How to prevent scanf causing a buffer overflow in C?
- How to convert a string to integer in C?
- How do I trim leading/trailing whitespace in a standard way?
- Why does scanf() need “%lf” for doubles, when printf() is okay with just “%f”?
- Using the equality operator == to compare two strings for equality in C [duplicate]
- C – scanf() vs gets() vs fgets()
- Scanf skips every other while loop in C
- strcmp on a line read with fgets
- Reading in double values with scanf in c
- Case Insensitive String Comparison in C
- How to extract numbers from string in c?
- How to check if a string is a number?
- Difference between scanf(“%c”, &c) and scanf(” %c”, &c) [duplicate]
- How to format strings using printf() to get equal length in the output
- Dynamic String Input – using scanf(“%as”)
- Why does scanf() need & operator (address-of) in some cases, and not others? [duplicate]
- whitespace in the format string (scanf)
- What is the difference between %f and %lf in C?