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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:07:49+00:00 2026-05-26T18:07:49+00:00

I have a struct like struct T { int *baseofint }Tstruct, *pTstruct; int one;

  • 0

I have a struct like

struct T {
   int *baseofint
}Tstruct, *pTstruct;

int one;
pTstruct pointer;

now i want to define

one = pointer.baseofint; //got filled with an integer; 
error message: **operator is not equal to operand**

I also tried

one = *(pointer.baseofint);
error message:**operand of * is no pointer*

Maybe someone can help, thanks.

  • 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-26T18:07:49+00:00Added an answer on May 26, 2026 at 6:07 pm

    First of all, I don’t think the following code is what you think it is:

    struct T {
       int *baseofint
    }Tstruct, *pTstruct;
    
    int one;
    pTstruct pointer;
    

    You’re declaring a structure type struct T, and creating an instance of it called Tstruct and a pointer to it called pTstruct. But those aren’t types you’re creating, they’re variables. That makes the pTstruct pointer; invalid code, too. What you probably intended was a typedef:

    typedef struct T {
      int *baseofint;
    } Tstruct, *pTstruct;
    

    …to make Tstruct equivalent to struct T, and pTstruct equivalent to struct T *.

    As for accessing and dereferencing the baseofint field, it’s slightly different depending on whether you’re accessing it through a pointer or not… but here’s how:

    Tstruct ts;          // a Tstruct instance
    pTstruct pts = &ts;  // a pTstruct -- being pointed at ts
    
    /* ...some code that points ts.baseofint at
     *    an int or array of int goes here... */
    
    /* with * operator... */
    int one  = *(ts.baseofint);   // via struct, eg. a Tstruct
    int oneb = *(pts->baseofint); // via pointer, eg. a pTstruct
    
    /* with array brackets... */
    int onec = ts.baseofint[0];   // via Tstruct
    int oned = pts->baseofint[0]; // via pTstruct
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a struct that takes a function pointer, like this: typedef int (*node_transition_func)(
.NET we have primitive datatypes like int and value types like struct. And also
Question 1 I have a struct like, struct foo { int a; char c;
I have a code that looks something like: struct Data { int value; };
Let's say I have a first structure like this: typedef struct { int ivalue;
I have a struct like this typedef struct _somestruct { int a; int b;
I have a struct like this: public struct stuff { public int ID; public
Suppose I have a struct containing a std::string, like this: struct userdata{ int uid;
Say I have a struct like the following ... typedef struct { int WheelCount;
I have a structure like struct category { int id,newID; std::string name; }; and

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.