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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:30:20+00:00 2026-06-11T14:30:20+00:00

I have a header and a sample application using this header, all in C,

  • 0

I have a header and a sample application using this header, all in C, I get almost all the logic of this software except for this; this the interesting part of the header:

struct A;
typedef struct A A;

in the C application this A is only used when declaring a pointer like this

A* aName;

I’m quite sure that this is a solution for just including A in the scope/namespace and give just a name to a basically void pointer, because this kind of pointer is only used to handle some kind of data, it is more like some namespace sugar.

What this could be for?

  • 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-11T14:30:21+00:00Added an answer on June 11, 2026 at 2:30 pm

    You’re correct that it’s like a void pointer, in that void is an incomplete type, and in this file A is also an incomplete type. About all you can do with incomplete types is pass around pointers to them.

    It has one advantage over void* in this file, that it’s a different and incompatible type from some other bit of code that has done the same thing with B. So you get a bit of type safety. If A is windowHandle and B is jpgHandle, then you can’t pass the wrong one to a function.

    It has an advantage over void* in the .c file that defines the functions that accept an A* — that file can contain a definition of struct A, and give A whatever members it wants, that the first file doesn’t need to know about.

    However, you say there are no other mentions of A in any header file, which means there are no functions that accept or return it. You also say that the only use of A in your source file is to declare pointers — I wonder where the values of those pointers come from, if any.

    If all that happens if that someone defines an uninitialized A* and never uses it, then clearly this is a remnant of some old code, or the start of some code that never got written, and it shouldn’t be in the file at all.

    Finally, if the real type is called something a bit less stupid than A, then the name might give a clue to its use.

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

Sidebar

Related Questions

I am new to ExtJS and have written a sample App using Ext.application with
I have the following formatted sample string: == header == information about things ==headeragain==
In my Java EE application page, I have header.jsp, a side menu.jsp, a body.jsp
I have been stuck on this all weekend and failed miserably! Please help me
I have tried using fopen, file-get-contents and a curl request but I always get
I have created a rails application that has a simple RESTful json API. This
I'm using this example project's XNA 4.0 form control in an application I'm writing:
I'm very new to WPF and am writing an application using this example as
I have a very simple C++ file Multiplier.cpp with the corresponding header file, from
I have some VERY simple code to return the title for a section header:

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.