ok i got things to work in a method that is what my professor has sort of guidelined for us but theres one problem with the ouput.
heres the code now:
Code:
/* Prompt user for the employees name, hours worked, and hourly rate */
for (x = 0; x < num_emp; x++)
{
fflush(stdin);
printf ("Enter the name for employee #%i: ", x + 1);
gets (emp_name[x]);
printf ("Enter the number of hours employee #%i worked: ", x + 1);
scanf ("%i", &hours_worked);
printf ("Enter the hourly rate of employee #%i: ", x + 1);
scanf ("%i", &hourly_rate);
/* Determine the gross pay */
if (hours_worked > 40)
{
}
/* Display the results for each of the employees entered */
printf ("Payroll Report\n");
printf ("--------------\n\n");
for (x = 0; x < num_emp; x++)
{
printf ("%s\n", emp_name[x]);
}
return 0;
} /* end main */
right now im just making sure its outputting the names correctly put there coming out like this:
John SmithJane Doe
Jane Doe
why would this be happening?