thanks once again tabstop
thank once again tabstop - following your instructions I now have a working program and compiles with no errors.
Code:
#include<stdio.h>
#include<pwd.h>
typedef struct store
{
char *ptr_string;
int user;
} point; /*point data type*/
main()
{
point array[10];
int i;
struct passwd *pwd;
setpwent();
for(i=0;i<10;i++)
{
pwd=getpwent();
array[i].ptr_string = (*pwd).pw_name;
array[i].user = (*pwd).pw_uid ;
printf("%s %d \n", array[i].ptr_string, array[i].user);
}
endpwent();
}
I took you advice and looked up '->' operator and basically found that is a pointer to a struct to differentiate between structure pointers and other pointers. However tabstop I used the '->' operator in the exact place of the '.' (dot)in the printf statement and I received this error:
Error - invalid type argument of '->'.
Nonetheless, I think my program now satisfies the requirements set out in the question.