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

  • Home
  • SEARCH
  • 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 769039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:16:26+00:00 2026-05-14T18:16:26+00:00

fprintf(stderr,Error in pcap_findalldevs: %s\n, errbuf); I don’t want to output anything via fprintf ,but

  • 0
fprintf(stderr,"Error in pcap_findalldevs: %s\n", errbuf);

I don’t want to output anything via fprintf,but only the result of "Error in pcap_findalldevs: %s\n", errbuf,what’s the function for that?

  • 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-05-14T18:16:27+00:00Added an answer on May 14, 2026 at 6:16 pm
    int sprintf(char * ptr, const char * format, ...)
    

    Writes the output and a terminating null to a buffer at ptr, returns the number of characters written excluding the null. Dangerous if you don’t know how big your output should be, it will blindly write past the end of the buffer.

    int snprintf(char * ptr, size_t n, const char * format, ...)
    

    Same as sprintf, but will write a maximum of n characters, including the trailing null. Returns the number of characters that would be written if n was large enough, so that you can reallocate your buffer if necessary.

    int asprintf(char ** ptr, const char * format, ...)
    

    Same as sprintf except a double pointer is passed in, the buffer will be resized if necessary to fit the output. This is a GNU extension, also available in BSD, it can be emulated like (Ignoring error checking)

    int asprintf(char ** ptr, const char * format, ...){
        va_list vlist;
        va_start(vlist,format);
        int n = vsnprintf(NULL,0,format,vlist);
        *ptr = realloc(*ptr,n+1);
        n = vsnprintf(*ptr,n+1,format,vlist);
        va_end(vlist);
        return n;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if for example i have : #define PRINT(x) fprintf(stderr, x); and in code i
I written this code: #include <stdio.h> #include <pthread.h> void* cuoco(void* arg) { fprintf(stderr,Inizio codice
symbol.c: In function 'symbol_FPrint': symbol.c:1209: warning: format '%ld' expects type 'long int', but argument
I have a main function, but when tcc goes to link everything together, it
I have this code: #include <stdio.h> #include <pthread.h> void* cuoco(void* arg) { fprintf(stderr,Inizio codice
I'm trying to do a project but I'm getting an error so please help
I had earlier posted a question, regarding same, but over here i want guidance
In case a system call function fails, we normally use perror to output the
I have a simple example for libxml2 but it returns the following error: $
In my code fprintf returns successfully by returning the number of bytes written in

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.