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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:29:10+00:00 2026-06-15T16:29:10+00:00

In the following code snippet, what can be done to a) hush the compiler,

  • 0

In the following code snippet, what can be done to a) hush the compiler, and b) clean up the eye-crossing pointer mess?

extern struct tree *sintablein[sintablesize];
struct tree *(*tablein)[];
int i;

tablein = &sintablein;     // The compiler complains:
                           // "redundant & applied to array (warning)" and
                           // "illegal conversion between pointer types (warning)"

for(i = 0; i < 10; i++) {
    struct tree *tablemember = (*tablein)[i];   // However, this works like a charm.
    // Do stuff with tablemember
}

The only way I was able to get this far was with the very helpful http://cdecl.org/. In particular regarding (b), how can I simplify the pointers and dereferences as much as possible?

  • 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-15T16:29:12+00:00Added an answer on June 15, 2026 at 4:29 pm

    I would do it like this:

    extern struct tree *sintablein[sintablesize];
    struct tree **tablein = sintablein;
    
    // ...
    
    for(i = 0; i < 10; i++) {
        struct tree *tablemember = tablein[i];
        // Do stuff with tablemember
    }
    

    Note that when you did (*tablein)[i] you were taking the first element of the tablein array and treating it as an array of struct tree items instead of a single struct tree* pointer. That’s probably not what you intended.

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

Sidebar

Related Questions

Can someone explain the following code snippet for me? // Bind base object so
How can I make sure in the following code snippet that IDataReader is disposed
the following code is a textmate javascript snippet, can anyone explain it please? cuz
Can some one explain the meaning of the following code snippet ( jQuery.fn[name] )
In the following code snippet, 'this.x()' can only be called in case 2 (see
In the following code snippet p is a node in a binary search tree,
I have the following snippet of code: struct Node { Node* left; Node* right;
The following code snippet on SQL server 2005 fails on the ampersand '&': select
The following code snippet is from The Official GNOME 2 Developer's Guide : GMemChunk
The following code snippet attempts to create a Tib DaemonManager connecting to a particular

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.