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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:01:11+00:00 2026-06-04T17:01:11+00:00

honestly i don’t known how to post this question… I have a global dynamic

  • 0

honestly i don’t known how to post this question…
I have a global dynamic list that is visible by all function of the program,
since today this list were filled reading data from a file.
but now i want to have a internal “list” that is loaded if no file it’s specified.
the list element are this:

// odb tuple
typedef struct _odb_t
{
const char *name,*value;
struct _odb_t *next;
} odb_t;

enum _method {GET,POST};

// odb type binding
typedef struct _odb_type
{
    enum _type type;
    const char *value;
    struct _odb_type *next;
} odb_type;

// defining online_db struct
typedef struct _odb
{
    const char *host,*file,*patrn;
    enum _method method;
    odb_type *types;
    odb_t *tuples;
    pthread_t thread; // the thread that is using this host
    struct _odb *next;
} odb;

how can i have an internal list into the .text section?
thanks in advance.

  • 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-04T17:01:12+00:00Added an answer on June 4, 2026 at 5:01 pm

    With C99 you can have so-called compound literals as some kind of unnamed variables and designated initializers to ease the writing of initializers. Your structures are a bit complicate that I can capture their complete meaning on a first glance, but something analogous to that here should work.

    odb const*const head = 
     &(odb const){
      .method = something,
      .next   = &(odb const){
         .method = another,
         .next = 0,
      },
    };
    

    Sure that you would have to initialize the other pointer fields analogously with the correct data, but I hope you get the idea.

    When used in file scope compound literals of the form (typename){ initiliazers } are allocated statically.

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

Sidebar

Related Questions

I have this Objective-C code that I found somewhere. Honestly, I don't understand a
This is an admittedly silly question, but I honestly don't know if this is
Please forgive the awkwardness of this question, I honestly don't know how to phrase
This really is a noobish question, but I honestly don't know how to solve
So, I'm working on a new project using ASP.NET MVC. Honestly I don't have
I'm honestly baffled by why this is throwing this particular exception. If I have
This is a question about an authentication scheme. Say I have a shared secret
I honestly don't understand why this doesn't work. Haven't seen anything close enough to
I honestly don't know what this is called or even begin how I search
I have all my inputs from the user (that end up in a mysql

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.