Results 1 to 3 of 3
Hi all!
I am running Linux C on my MacBook Pro and cannot get the struct command to work properly. Below is the basic code and RUNTIME errors I am ...
- 12-03-2008 #1Just Joined!
- Join Date
- Dec 2008
- Posts
- 2
struct command, run time errors
Hi all!
I am running Linux C on my MacBook Pro and cannot get the struct command to work properly. Below is the basic code and RUNTIME errors I am getting. Any feedback on this would be GREATLY appreciated.
Thanks,
#include <stdio.h>
typedef struct Payroll
{
int empNumber;
char name[25];
double hours;
double payRate;
double grossPay;
} Payroll;
int main()
{
struct PayRoll employee;
// Get the employee's number
printf("Enter the employee number: ");
scanf("%d",&employee.empNumber);
printf("%d",&employee.empNumber);
}
john-crispin-4s-macbook:~ johncrispin1$ gcc -o RecordExample RecordExample.c
john-crispin-4s-macbook:~ johncrispin1$ ./RecordExample.c
./RecordExample.c: line 4: typedef: command not found
./RecordExample.c: line 11: syntax error near unexpected token `Payroll'
./RecordExample.c: line 11: `} Payroll;'
john-crispin-4s-macbook:~ johncrispin1$
- 12-03-2008 #2
the ./ attempts to execute that source file as a bash script, not a binary executable
- 12-05-2008 #3Just Joined!
- Join Date
- Dec 2008
- Posts
- 2
run command
Thanks. I realized after I submitted the post that I using the .c extension on the run command. After I took it off it ran fine. Thanks again for the reply.


Reply With Quote