Search:

Type: Posts; User: quasigreat

Search: Search took 0.01 seconds.

  1. Thread: isdigit

    by quasigreat
    Replies
    2
    Views
    1,623

    Thanks!

    Thanks!
  2. Thread: isdigit

    by quasigreat
    Replies
    2
    Views
    1,623

    isdigit

    Hi, all, just a quick question -- will isdigit() return true for the null char at the end of a string?
  3. Hmm. This seems straightforward, and yet this...

    Hmm. This seems straightforward, and yet this gets me "warning: passing argument 1 of ‘strcpy’ makes pointer from integer without a cast"--for both arguments.
    strcpy(*((*flights)[i].origin),...
  4. Thanks for pointing that out--you likely saved me...

    Thanks for pointing that out--you likely saved me a good deal of hair-pulling time. I know I don't need to cast malloc, but the instructor makes us do it anyway. The compiler may be God, but the prof...
  5. OK, I think I understand--like so: flights =...

    OK, I think I understand--like so:
    flights = (Flight **)malloc((size_t)*num_flights*sizeof(Flight));How would I use this in a for loop? Simply replacing i with flights doesn't seem to work, but...
  6. trouble with arrays of structs and the dynamic allocation thereof

    Hi, all--
    I'm working on an airline reservation program, and I think I've gotten myself all turned around with respect to the pointers. Here's the relevant code:


    typedef struct
    {
    int number;...
  7. Replies
    4
    Views
    2,910

    Hm, you're right. Rereading the assignment, I...

    Hm, you're right. Rereading the assignment, I noticed this bit: "Since you will be dynamically allocating the arrays in read_file() the addresses of the original char** of last_names and first_names...
  8. Replies
    4
    Views
    2,910

    incompatible pointer types

    Hi, all--
    This program is meant to read a list of names and ages from a file and store them in arrays. Unfortunately, I've only gotten as far as dynamically allocating the arrays, and I'm already...
  9. Replies
    11
    Views
    2,813

    Thank you all very much for the help and your...

    Thank you all very much for the help and your patience. It's working perfectly now. I probably sound like a bit of an idiot--that's because the course I'm currently taking is pretty much my first...
  10. Replies
    11
    Views
    2,813

    OK, thank you, that makes sense. I've changed it...

    OK, thank you, that makes sense. I've changed it back to:


    while(wordptr[i] != NULL)
    {
    wordptr[i] = strtok(NULL, " \n");
    i++;
    }

    And the output is as follows:
  11. Replies
    11
    Views
    2,813

    reversing a string

    Hi, all--
    I'm writing a program to reverse a string word by word, e.g. "some words" becomes "words some", and I'm having some trouble getting it to ignore the null portion of the array. Here's my...
  12. Ah, of course! That's fixed it, thank you much.

    Ah, of course! That's fixed it, thank you much.
  13. "warning: passing argument 2 of ‘strcat’ makes pointer from integer without a cast"

    Hi, all--
    I'm writing a program to find the longest common prefix of two words (e.g. input "department" and "depart", get "depart" back; input "global" and "glossary", get "glo" back), and when I...
  14. Replies
    4
    Views
    2,010

    Thanks so much, that's fixed it. Eternal...

    Thanks so much, that's fixed it. Eternal gratitude, coming right up. :D
  15. Replies
    4
    Views
    2,010

    Hmm. I'm not sure I understand. Just before the...

    Hmm. I'm not sure I understand. Just before the while loop begins, there's this line:

    fscanf(inp, "%lf%lf%lf", &num_passengers, &commute, &gas_used);
    Is there some reason I'm not aware of that...
  16. Replies
    4
    Views
    2,010

    trouble with file pointers...

    Hi, all--this time I've got a program that's supposed to calculate passenger efficiency in passenger kilometers per liter, given an input file that lists number of passengers, total commuting...
  17. Thank you! That's fixed it. In the instructor's...

    Thank you! That's fixed it. In the instructor's executable, entering a filename for a file that doesn't exist causes a segmentation fault, so it's not something I need to worry about in this context....
  18. problems reading input file into two arrays

    Hi, it's me again. *waves* I'm having some trouble, and I could really use a fresh set (or sets) of eyes.

    This program is supposed to take two lists of integers of the same length ended by -1 and...
  19. Replies
    5
    Views
    1,526

    Thank you both very much, it's working perfectly...

    Thank you both very much, it's working perfectly now.

    The comments refer to the previous if statement, i.e. "check neighbor up and to the left" refers to if(life[row-1][column-1]=='X'). And...
  20. Replies
    5
    Views
    1,526

    Thank you! It's fixed now. I wonder if I might...

    Thank you! It's fixed now.

    I wonder if I might trouble you further to take a look at my update_life function, as it doesn't seem to be working. It's meant to count the number of Xs in neighboring...
  21. Replies
    5
    Views
    1,526

    issues working with two-dimensional array

    Hi--I'm trying to implement Conway's Game of Life on a 10x10 board (with borders), and I'm having a bit of trouble. At this point, it seems most likely that said trouble lies in either my display...
Results 1 to 21 of 21