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;
}
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:
Remember an array:
Goes from
row[0]torow[X-1]. So in your caseX=3that means your min/max values for your array are:That means your code should do something like: