Home > Back-end >  Error C2440: '=' : always convert from 'int (*) [7]' to 'int * how wrong pr
Error C2440: '=' : always convert from 'int (*) [7]' to 'int * how wrong pr

Time:09-15

#include
# define SIZE 30
Struct peolpe
{
Int num.
Char name [20].
Char sex [3].
Char department [15].
Int salary [6].
Int meritpay [6].
Int bonus [6].
Int finalpay [7].

};

Void meanu (void);
Void modimeanu (void);
Void dealmeanu (void);
Void stameanu (void);
Int input (struct peolpe p [SIZE]);
Void modi (struct peolpe p [SIZE], int n);
Void deal (struct peolpe p [SIZE], int n);
Void prin (struct peolpe p [SIZE], int n);
Void salary (struct peolpe p [SIZE], int n);
Void meritpay (struct peolpe p [SIZE], int n);
Void bonus (struct peolpe p [SIZE], int n);
Void finalpay (struct peolpe p [SIZE], int n);
Void sort (struct peolpe p [SIZE], int n);
Void stat (struct peolpe p [SIZE], int n);
Void total (struct peolpe p [SIZE], int n);

Void main ()
{
Int number=0;/* the Numbers that have had input */
Int c;
Struct peolpe stu [SIZE];
Do/* fan fu diao yong zu CAI dang, */
{
Meanu ();
The scanf (" % d ", & amp; C);
The switch (c)
{
Case 1: the number=input (stu); break;
Case 2: modi (stu, number); break;
Case 3: deal (stu, number); break;
Case 4: prin (stu, number); break;
Case 5: printf (" \ \ t tthank you for using! \n"); break;
Default: printf (" \ \ t tdo not have this operation, both please rechoose. \ n "); break;
}
} while (c!=5);
}
Void meanu ()/* the main meanu */
{
Printf (" \ n \ t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");
Printf (" \ \ t t 1. Input the data 2. Rewrite the data 3. Deal with the data 4. The output data 5. Qut \ n ");
Printf (" \ n \ t * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \ n ");
Printf (" \ t \ t please select your operating (1-5) ");
}
Void modimeanu ()/* rewriting men project 's meanu */
{
Printf (" \ t 1: work number 2:3: gender name 4: division 5: basic wage 6: performance-related pay 7:8: bonus should pay 9: quit. ");
Printf (" \ t \ t please select your operating (1-9) ");
}
Void dealmeanu ()
{
Printf (" \ t 1: sort by job number, display all the data for all staff, 2: according to the working status query, display all the data for a specified job number, \ n ");
Printf (" \ t \ t please select your operating (1-9) ");
}
Void statmeanu ()
{
Printf (" \ t 1:2: statistical average wage returns the parent menu. \ n ");
Printf (" please choose your operation (1-2) ");
}
Int input (struct peolpe p [SIZE])
{
Int n=0;
Printf (" please input the first % d t \ \ t employees gonghaowu (enter 0 means that the end) : ", n + 1);
The scanf (" % d ", & amp; P [n]. Num);
While (p [n]. Num!=0)
{
Printf (" please enter the first % t \ \ t d a staff name: ", n + 1);
The scanf (" % s ", p [n]. Name);
Printf (" please enter the first % t \ \ t d a staff of gender: ", n + 1);
The scanf (" % s ", p [n]. Sex);
Printf (" \ t \ t: please enter the first % d staff department ", n + 1);
The scanf (" % s ", p [n]. Department);
Printf (" please input the first % d t \ \ t employee's basic salary: ", n + 1);
The scanf (" % d ", p [n]. Salary).
Printf (" please input % d t \ \ t employee performance salary: ", n + 1);
The scanf (" % d ", p [n]. Meritpay);
Printf (" please input % d t \ \ t the bonuses of their staff: ", n + 1);
The scanf (" % d ", p [n]. Bonus).
Printf (" \ \ t t enter the % d staff should pay: ", n + 1);
The scanf (" % d ", p [n]. Finalpay);
n++;
Printf (" please enter % d a t \ \ t employees gonghaowu end when [0] : ", n + 1);
The scanf (" % d ", & amp; P [n]. Num);
}
Return n.
}
Void modi (struct peolpe p [SIZE], int n)
{
Int I, c, no;
Int flag1=0;
Printf (" \ \ t tplease input the staff 's number: ");
The scanf (" % d ", & amp; No);
for(i=0; i{
If (p [I] num==no)
{
Flag1=1;
break;
}
}
If (flag1==1)
{
Do
{
Modimeanu ();
The scanf (" % d ", & amp; C);
The switch (c)
{
Case 1: printf (" \ t/t, please enter the new job number: "); The scanf (" % d ", & amp; P [I] num); break;
Case 2: printf (" \ t \ t please enter a new name: "); The scanf (" % s ", & amp; P [I] name); break;
Case 3: printf (" \ t \ t please enter new gender: "); The scanf (" % s ", & amp; P [I] sex); break;
Case 4: printf (" \ t \ t: please enter a new department "); The scanf (" % s ", & amp; P [I]. Department); break;
Case 5: printf (" \ t \ t basic salary: please enter a new "); The scanf (" % d ", & amp; P [I]. Salary); break;
Case 6: printf (" please enter a new pay-for-performance: t \ \ t "); The scanf (" % d ", & amp; P [I] meritpay); break;
Case 7: printf (" \ t/t, please input the new bonus: "); The scanf (" % d ", & amp; P [I]. Bonus); break;
Case 8: printf (" \ t \ t please enter new should pay: "); The scanf (" % d ", & amp; P [I] finalpay); break;
Case 9: break;
Default: printf (" wrong! Plaese rechoose. "); break;
}
} while (c!=9);
Printf (" \ \ t tthe staff 's new data is: \ n ");
Printf (" \ t \ \ t t % d % s \ \ t t % s % s ", p [I] num, p [I]. Name, p [I] sex, p [I] department);
printf("\n");
Printf (" \ t \ \ t t % d % d \ \ t t % d % d ", p [I]. Salary, p [I] meritpay, p [I]. Bonus, p [I] finalpay);
}
The else printf (" the number don 't exist. ");
}
Void deal (struct peolpe p [SIZE], int n)
{
Int c;
Do
{
Dealmeanu ();
The scanf (" % d ", & amp; C);
The switch (c)
{
Case 1: sort (p, n); break;
Case 2: the stat (p, n); break;
Case 3: break;
Default: printf (" \ t \ twrong!!! \n");
}
} while (c!=3);
}
Void sort (struct peolpe p [SIZE], int n)
{
int i,j;
for(i=0; i{
for(j=0; j{
If (p [j] num> P [I] num)
Printf (" % d ", [j]. J p num);
break;
}
}
}

Void stat (struct peolpe p [], int n)
{
Int c;
Do
{
Statmeanu ();
The scanf (" % d ", & amp; C);
The switch (c)
{
Case 1: total (p, n); break;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related