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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:46:34+00:00 2026-05-12T16:46:34+00:00

I have code in my header file that looks like: typedef struct _bn bnode;

  • 0

I have code in my header file that looks like:

typedef struct _bn bnode;

I can do

bnode b;

just fine, but

b[i], where i is an int gives me the following error:

invalid use of undefined type ‘struct _bn’

Any ideas?

  • 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-12T16:46:34+00:00Added an answer on May 12, 2026 at 4:46 pm

    As far as an API/library goes, normally if you’re going to need an opaque structure, you don’t allow the user of the API to declare things like arrays or static instances because of this. Not knowing anything about the structure is the name of the game so you’re probably going to have to define some functions to manipulate them. Most C libraries that declare opaque structures often has accessor and modification functions.

    One example is from Lua (obviously a Lua state is an single use structure but it’s the idea):

    typedef struct lua_State lua_State;
    void lua_pushnumber(lua_State *s, lua_Number n);
    

    In this case, if you decided you needed multiple Lua states, you would do something like the following:

    lua_State *states[5];
    for(int i = 0; i < 5; i++)
        states[i] = lua_open();
    

    I think the general rule-of-thumb is that if you’re working with opaque structures, you’re going to be working through pointers only, which is pretty much the only way to go about it anyway.

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

Sidebar

Ask A Question

Stats

  • Questions 191k
  • Answers 191k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your risks are no greater than web development in general.… May 12, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer Deploy two identical copies of the same WAR file, one… May 12, 2026 at 6:13 pm
  • Editorial Team
    Editorial Team added an answer This is late, but i think that Lucene.Net is now… May 12, 2026 at 6:13 pm

Related Questions

I have a class with a static method that looks roughly like: class X
I hope I'm wording my question properly, but what I'm trying to do is
I have Nginx as my front-end web server listening on port 80. And certain
Still working on a problem that started from here Calling C++ dll function from
I am working on a reliable file transfer program that uses UDP. (for a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.