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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:46:44+00:00 2026-06-17T22:46:44+00:00

Given a user-defined type A , and a pointer A* a , what is

  • 0

Given a user-defined type A, and a pointer A* a, what is the difference between *a and a[0]?

(Though *(a+0)/a[0] are defined to be equivalent, the same is not the case for *a/a[0], where a subtle difference may cause a compilation error in certain circumstances.)

  • 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-17T22:46:45+00:00Added an answer on June 17, 2026 at 10:46 pm

    If A is an incomplete type, *a works, but a[0] does not, in this example:

    struct A;
    
    void foo(A& r)
    {
    }
    
    void bar(A* a)
    {
        foo(*a);
        foo(a[0]);   // error: invalid use of incomplete type ‘struct A’
    }
    

    That’s because a[0] is equivalent to *(a+0), but you cannot add something to a pointer to an object of incomplete type (not even zero), because pointer arithmetic requires the size to be known.

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

Sidebar

Related Questions

I'm building an Access database and I'm getting a User-defined type not defined error
Setup Given this user-defined type: struct T { static int x; int y; T()
Given models User and Comments being populated such that a user may have many
How can I check if the user has given permission and not disabled (publish_action)
The below code gives me User-defined conversion must convert to or from enclosing type,
Actually I have created a User defined table type in sql server 2008. Structure
Consider I have a user-defined type as follows: CREATE TYPE mytype AS (myvar character(1),
So I have the following user defined type in my oracle database: CREATE OR
I have a class called UserInfo that contains details about a given user. There
Given a user input string, I need to find if it end with one

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.