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 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

Related Questions

I have code that looks like the following, which works fine for displaying the
Basically I have code which looks like this inside a header file: class Bar;
I have an xml file that looks like this; <Employee> <EmployeeName>Burt Reynolds</EmployeeName> <EmployeeTitle>Bad Ass</EmployeeTitle>
I have the following html code: <h3 id=headerid><span onclick=expandCollapse('headerid')>&uArr;</span>Header title</h3> I would like to
I have code that references a web service, and I'd like the address of
I have code like this: template <typename T, typename U> struct MyStruct { T
I have the following code header(Content-Description: File Transfer); header('Content-Type: audio/mp3'); header(Content-Disposition: attachment; filename= .
I have code like this: var newMsg = new Msg { Var1 = var1,
I have code like this to move the player in my game left, right,
I am using the EOF function in my php code. But I have a

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.