Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:08:07+00:00 2026-06-04T19:08:07+00:00

sscanf(line, %d %64[^\n, &seconds, message); does %64[^ mean – up to 64 characters? Should

  • 0
sscanf(line, "%d %64[^\n", &seconds, message);

does %64[^ mean – up to 64 characters?
Should it work with GNU C Compiler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:08:09+00:00Added an answer on June 4, 2026 at 7:08 pm

    It means “read at most 64 characters or stop when reaching a newline, whichever comes first”. It’s specified by the standard so all standard libraries have to support it.

    C11 7.21.6.2

    [ Matches a nonempty sequence of characters from a set of expected
    characters (the scanset).
    […]
    The conversion specifier includes all subsequent characters in the
    format string, up to and including the matching right bracket (]).

    The characters between the brackets (the scanlist) compose the
    scanset, unless the character after the left bracket is a circumflex
    (^), in which case the scanset contains all characters that do not
    appear in the scanlist
    between the circumflex and the right bracket.

    As noted in the comments, a matching ] is probably required to delimit the scanlist. An s specifier is not required.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning about sscanf and came across a format string as below: sscanf(%[^:]:%[^*=]%*[*=]%n,a,b,&c);
What will be occurred in this lines of code : char Message[10]; scanf(%s%*,&Message,'?'); Why
#include<stdio.h> #include<conio.h> int main(){ char i; int c; scanf(%i,&c); scanf(%c,&i);// catch the new line
I have a function that makes a series of calls to sscanf() and then,
gcc 4.4.2 I have the following code: char channels[] = NumberOfChannel = [2]; sscanf(channels,
When I compile scanf(%s, &var); , gcc sends back a warning: warning: format ‘%s’
Is a = getchar() equivalent to scanf(%c,&a); ? Is putchar(a) equivalent to printf(%c,a); where
Is it correct to use scanf() as follows: int n; scanf([%d], &n); If so,
further developing the code from yesterday ( seg fault caused by malloc and sscanf
You can specify an MTD device by name on the kernel command line root=mtd:name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.