Hey, im new to this forum , and just new to c language. Im trying to do simple program for like 6 hours!!! and its just not able too work, please help me if you can:
Code:
struct date {
int day;
int month;
int year;
}now;
struct det{
char name[32];
struct date b;
int salary;
};
struct det worker [5]={{"shosho",12,12,1937,16500},{"mosho",11,11,1950,2500},{"dosho",10,10,1922,5467},{"fosho",9,9,1967,3222},{"sosho",8,8,2008,12342345}};
void main ()
{
char c[32];
int i,hef=0,d=0;
now.day=10;
now.month=5;
now.year=2011;
puts ("PUT NAME OF THE WORKER");
gets (c);
for (i=0;i<5;i++)
{
hef=((now.year*10000+now.month*100+now.day)-(worker[i].b.year*10000+worker[i].b.month*100+worker[i].b.day)/10000);
if (worker[i].name==c)
{
if (hef>= 67)
puts("YOU GOT IT");
else
puts("come later");
}
else
{
d++;
if (d==5)
puts("no name like this");
}
}
}
the problem is that when i write an existing name (like mosho) it should chek his age and if its more than 67 print something, if its less print another thing, but the program cannot rekognize existing name :S