Ok I know the problem is with how I am using the struct. Anyone able to smack me into the right direction?
Code:
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#define MAX 2
int main()
{
int count;
struct city
{
int sec;
char name[15];
}names[MAX];
for (count=0;count<MAX;count++)
{
printf("\nCity %d:\nType in sector: ",count);
scanf("%d",&names[count].sec);
printf("Type in name: ");
scanf("%s",&names[count].sec);
}
for (count=0;count<MAX;count++)
printf("City %d in Sector %d with the name of %s.\n", count, names[count].sec, names[count].name);
system("PAUSE");
return 0;
}