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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:07:18+00:00 2026-06-13T05:07:18+00:00

..then to an array, or along those lines. I’m so confused on what I’m

  • 0

..then to an array, or along those lines. I’m so confused on what I’m supposed to do.

Here are the structs:

typedef struct {
  char name[30];
} PersonType;

typedef struct {
  PersonType *personInfo;
} StudentType;

typedef struct {
  StudentType students[30];
} GraduateType;

I want to get the name of the PersonType. Something like this, in main():

GraduateType *gptr = (GraduateType *) calloc(3, sizeof(GraduateType));
// Assume here that info has been scanf()'d
int i, j;
for(i = 0; i < 3; i++) {
  for(j = 0; j < 2; j++) {
    if(strcmp(gptr[i].students[j].personInfo.name, "asd")) { // <- This
      // blah
    }
  }
}

How?

  • 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-13T05:07:19+00:00Added an answer on June 13, 2026 at 5:07 am

    You were almost there. personInfo is a pointer, so you should treat it as such:

    gptr[i].students[j].personInfo->name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to set an array recursively? something along these lines: $array
I tried to encrypt an array then decrypt it back to string by calling
I want to initialize an array and then initialize a pointer to that array.
I create an array that then prints in sets of five. I want to
When I add items to the beats array and then console.log the User, I'm
I would like to read multiple XML files in an array and then parse
I'm trying to store the files listing into an array and then loop through
I'm trying to determine what a value is in an array and then implement
I need to serialize ArrayList<String> arr=new ArrayList<String>(); on server and then send this array
I am exploding an array appending it and then I am imploding the array

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.