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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:23:53+00:00 2026-06-16T00:23:53+00:00

I need to add the numbers in the row array mentioned in the structure.

  • 0

I need to add the numbers in the row array mentioned in the structure.
for example I need the output of row=[ 4 5 6]
and age= 25, how can i do with the above mentioned structure??
Please help !

#include<stdio.h>

typedef struct person
{
    int row[1];
    int age;
} PERSON;

int main()
{
    PERSON p;
    PERSON *pptr=&p;

    pptr->row[1] = 4;
    pptr->age = 25;
    printf("%d\n",pptr->row[1]);
    printf("%d\n",pptr->age);
    return 0;
}
  • 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-16T00:23:54+00:00Added an answer on June 16, 2026 at 12:23 am

    I need to add the numbers in the row array mentioned in the structure. for example I need the output of row=[ 4 5 6] and age= 25, how can i do with the above mentioned structure?? Please help !

    Based on this update:

    Put the number of elements you want to store into the array defination:

    int row[1]; // This stores 1 element of type int
    
    // you want to store 3 elements: 4, 5, 6, so...
    
    int row[3];  // This is what you're looking for
    

    Remember an array:

    int row[X];
    

    Goes from row[0] to row[X-1]. So in your case X=3 that means your min/max values for your array are:

    min = row[0]
    max = row[3-1] = row[2]
    

    That means your code should do something like:

    pptr->row[0] = 4;
    pptr->row[1] = 5;
    pptr->row[2] = 6;
    pptr->age = 25;
    printf("%d\n",pptr->row[0]);
    printf("%d\n",pptr->row[1]);
    printf("%d\n",pptr->row[2]);
    printf("%d\n",pptr->age);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't access a element with its href. Like this example, i need add
I need to display array of 10 numbers in three columns. if i add
i need Add Row Numbers To a SELECT Query without using Row_Number() function. and
I am writing a Visual Basic IDE, and I need to add lines numbers
I need to design a function to return negative numbers unchanged but should add
I need some help with allocating arrays dynamically. I have an array whose size
I need to sort through an array and sort each individual row in array
I have a 2-dimensional array of string I need to add items to this
i have a string and i need to add a number to it i.e
I have an empty LinearLayout , and I need to add a dynamic number

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.