Search:

Type: Posts; User: Fox101

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: fgets issue

    by Fox101
    Replies
    2
    Views
    1,836

    ah ok.

    ah ok.
  2. Thread: fgets issue

    by Fox101
    Replies
    2
    Views
    1,836

    fgets issue

    #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;
  3. Thread: Practice

    by Fox101
    Replies
    4
    Views
    1,459

    hahaha hilarious

    hahaha hilarious
  4. Thread: Practice

    by Fox101
    Replies
    4
    Views
    1,459

    Practice

    I'm bored and looking for some practice, anyone got any ideas for a c++ program for me to work on?
  5. Thread: segFault

    by Fox101
    Replies
    1
    Views
    1,690

    segFault

    void hire(FILE **infile, char lineOfText[], struct employee **firstEmployee)
    {
    struct employee *newEmployee = NULL;
    struct employee *previousEmployee = NULL;
    struct employee...
  6. Replies
    3
    Views
    1,485

    That fixed it, thank you sir.

    That fixed it, thank you sir.
  7. Replies
    3
    Views
    1,485

    Can't get out of function

    case 'H':
    hire(&infile, lineOfText, &firstEmployee);
    printList(firstEmployee);
    printf("hello");
    break;




    void printList(struct employee *currentEmployee)
  8. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    Ah ok. *What exactly does the perror()...

    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...
  9. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    Its in the scource area with my constants and...

    Its in the scource area with my constants and main.c file.
  10. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    Yeh, I know what you mean, however he subtracts...

    Yeh, I know what you mean, however he subtracts points if I use 0 or 1 heh.
  11. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    We are not allowed to use hard coded numbers. ...

    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...
  12. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    Ah, I tried the method in your link, my file is...

    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.
  13. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    I've been trying many things for the past day,...

    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...
  14. Thread: Seg fault

    by Fox101
    Replies
    18
    Views
    3,119

    Seg fault

    #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
  15. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    I get the warning that assignment makes integer...

    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?
  16. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    { int index; int loop; int temp_id; int...

    {
    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++)
    {
  17. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    My other problem was that the else was inside the...

    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.
  18. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    so firstName[0] = '\0'; will null out all of the...

    so firstName[0] = '\0'; will null out all of the columns in the first row?
  19. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    well the break; worked, but I don't see why its...

    well the break; worked, but I don't see why its not just skipping of the else if the if() is executed.
  20. Thread: if else loop

    by Fox101
    Replies
    19
    Views
    3,173

    if else loop

    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;...
  21. Replies
    4
    Views
    1,118

    Um, lets see.... the string char...

    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...
  22. Replies
    4
    Views
    1,118

    2d strings and setting to null

    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?
  23. Thread: Question

    by Fox101
    Replies
    4
    Views
    789

    id[*numEmploy] is what I am gonna try. That way...

    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.
  24. Thread: Question

    by Fox101
    Replies
    4
    Views
    789

    Well, that was an error I did not see but my...

    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...
  25. Thread: Question

    by Fox101
    Replies
    4
    Views
    789

    Question

    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)...
Results 1 to 25 of 37
Page 1 of 2 1 2