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 7752377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:47:04+00:00 2026-06-01T11:47:04+00:00

I structures like the following typedef struct { char *ptr; size_t used; size_t size;

  • 0

I structures like the following

typedef struct 
{

    char *ptr;

    size_t used;
    size_t size;

} buffer;

typedef struct 
{

    buffer *request;
    buffer *uri;

    buffer *orig_uri;

    http_method_t  http_method;
    http_version_t http_version;

    buffer *request_line;

    /* strings to the header */
    buffer *http_host; /* not alloced */
    const char   *http_range;
    const char   *http_content_type;
    const char   *http_if_modified_since;
    const char   *http_if_none_match;

    array  *headers;

    /* CONTENT */
    size_t content_length; /* returned by strtoul() */

    /* internal representation */
    int     accept_encoding;

    /* internal */
    buffer *pathinfo;
} request;

Now if I want to write(in a text file) the value of the member “http_host” which belongs to the structure “request”. The member “http_host” is actually a “buffer” type, how should I write it? Kindly explain with the syntax.

  • 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-01T11:47:06+00:00Added an answer on June 1, 2026 at 11:47 am

    Have you tried something like this?

    // open the file
    FILE *fp = fopen("myfile.txt");
    
    // print
    fprintf(fp, "%s\n", http_host->ptr);
    
    // close the file
    fclose(fp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I will code some thing like following: typedef struct { int a; PTR1
I have the following struct in C++: #define MAXCHARS 15 typedef struct { char
I have a structure defined like so: typedef struct { int n; int *n_p;
Given the following structure: struct nmslist_elem_s { nmptr data; struct nmslist_elem_s *next; }; typedef
I have the following header file: typedef struct my_data my_data_t; my_data_t* new_my_data(void); void free_my_data(my_data_t*
I'm programming for a µC, i have following data Structure: typedef struct { RF12Head
In the header file of the dll I have the following structure typedef struct
Whether following structure declaration is right. typedef struct { int roll; int age ;
So, I have some code, kind of like the following, to add a struct
I have a structure like the following: <form> <input type=text /> <input type=text />

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.