Originally Posted by
kitymarine
I dont know why the admin closed my thread but it is a polite way of communication..Secondly Instead of jumping and accuse me of dumping my assignment I was out of connection yesterday and I could not post my code...For better communication I hope from the Oe Called Salem to be more formal until he will know what people are posting..and this is my tag
First off Salem is one of the fairest moderators I've worked with. If you have specific questions ask them... post code snippets when possible...
Code:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#define nmax 10
typedef struct Person <-- typedefs go above main
{ char name[30];
char adresse[30];
char city[30];
char state[30];
int zip;
int age;
char gender; };
int main(void) <--- this is the correct form
{
struct Person people[nmax];
int i;
for(i=0;i<nmax;i++)
{ printf("Enter the information for the person number : %d\n ",i+1);
printf("Enter name: ");
scanf("%29s",people[i].name);
printf("Enter street adresse : "); <-- that is a prompt so stop
scanf("%29s",people[i].adresse); fussing over it.
printf("Enter city : ");
scanf("%29s",people[i].city);
printf("Enter state : ");
scanf("%29s",people[i].state); <-- string size limits prevent
printf("Enter zip code : "); buffer overflows
scanf("%d",&people[i].zip);
printf("Enter age : ");
scanf("%d",&people[i].age);
printf("Enter gender(M or F) : ");
scanf("%s",&people[i].gender);
printf("\n\n"); }
system("PAUSE");
return 0; } <-- always return a value