ah ok.
Type: Posts; User: Fox101
ah ok.
#include<stdio.h>
#include<string.h>
void avg_min (double *, int *, FILE *);
int main (void)
{
double avg, preavg, postavg, quizavg;
int min, premin, postmin, quizmin, check;
hahaha hilarious
I'm bored and looking for some practice, anyone got any ideas for a c++ program for me to work on?
void hire(FILE **infile, char lineOfText[], struct employee **firstEmployee)
{
struct employee *newEmployee = NULL;
struct employee *previousEmployee = NULL;
struct employee...
That fixed it, thank you sir.
case 'H':
hire(&infile, lineOfText, &firstEmployee);
printList(firstEmployee);
printf("hello");
break;
void printList(struct employee *currentEmployee)
Ah ok.
*What exactly does the perror() function do. Right now it is printing out success after my file name, but using the example given in the link above, the return(EXIT_FAILURE) is run...
Its in the scource area with my constants and main.c file.
Yeh, I know what you mean, however he subtracts points if I use 0 or 1 heh.
We are not allowed to use hard coded numbers. Our prof wants every number to be defined in the constants file.
*The program now runs through main now on the unix server, just cant figure out...
Ah, I tried the method in your link, my file is not opening correctly. Now I'm just not sure where to put my input file in xcode.
I've been trying many things for the past day, and from what I can tell is that it is not even reaching the main function. The printf("hello"); is not printing, which is the first thing in the main...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TWOI 2
#define CLASS_SIZE 20
#define NAME_SIZE 20
#define ONEI 1
#define SALARY_SIZE 2
#define TEXT_BUFFER 81
I get the warning that assignment makes integer from pointer without a cast. its on all 3 lines where it should be nulling out the strings. What does this warning mean?
{
int index;
int loop;
int temp_id;
int valid_id = FALSE;
printf("Enter the employee's id number: ");
scanf("%d", &temp_id);
for(index = ZEROI; index < MAX_EMPLOYEE; index++)
{
My other problem was that the else was inside the for loop, so while it searched to see if the id was valid it printed the statement every time it was not. I fixed that issue.
so firstName[0] = '\0'; will null out all of the columns in the first row?
well the break; worked, but I don't see why its not just skipping of the else if the if() is executed.
printf("Enter the employee's id number: ");
scanf("%d", &temp_id);
for(index = ZEROI; index < MAX_EMPLOYEE; index++)
{
if(temp_id == id[index])
{
for(loop = ZEROI; loop <= COLUMN;...
Um, lets see....
the string char firstName[5][20]={' '};
So every space in the string is null character.
through a scanf statement later on I give firstName[0][0] the name of Bob.
Now I...
If an array
char firstName[5][20] = {' '};
in the program you give firstName[0] = name by a scanf statement.
Now, I need to reset firstName [0][0] = all null.
How do I do this?
id[*numEmploy] is what I am gonna try. That way it will put the id number in the slot of the next employee.
Edit* And it worked, cool beans.
Well, that was an error I did not see but my problem still remains. The problem is that index is incremented while checking to see if the ID is already in use. After the loop I want to set the...
void hire(char firstName[][20], char lastName[][20],char class[][20], int id[], int *numEmploy)
{
int ident=ZEROI;
int index=ZEROI;
int valid_id;
if(*numEmploy >= MAX_EMPLOYEE)...