Search:

Type: Posts; User: dford425

Search: Search took 0.01 seconds.

  1. I figured it out, I mis-understood how the...

    I figured it out, I mis-understood how the provided code for the tree works. It seems that the "root" node is not actually the root and I have to pass the tree->root->left node. I assumed this was...
  2. I'm using the same tree that was printed with the...

    I'm using the same tree that was printed with the supplied code.

    I also narrowed down where the issue is using print statements. I go to my function to print the nodes

    void...
  3. Can't firgure out why im getting a segmentation fualt

    I am getting a Segmentation Fault when im trying to pass the tree and its root so that the tree can be traversed. The code for an In-Order traversal was given to me and it works. Here is what how i...
  4. Replies
    2
    Views
    1,014

    issue reading in text

    I'm trying to read in lines of text from a file. The line will be formatted in one of three ways. It will either be just a character, a character and one string or a character and two strings....
  5. Replies
    3
    Views
    814

    Thanks for the quick replys, fflush() worked.

    Thanks for the quick replys, fflush() worked.
  6. Replies
    3
    Views
    814

    Need help writing to file

    I need help writing to a file. I can't get it to work but its not giving any errors.


    #define OUTPUT "output.txt"
    ...
    out = fopen(OUTPUT, "w");
    if(!out) fatal("Could not open %s for...
  7. Replies
    6
    Views
    3,519

    That worked, thank you.

    That worked, thank you.
  8. Replies
    6
    Views
    3,519

    Thanks, I put extern in front of the definintion...

    Thanks, I put extern in front of the definintion in the .h file and tried to compile. This is what i got, im not sure what it means.

    In file included from Card.c:11:
    Card.h:17: warning: ‘ranks’...
  9. Replies
    6
    Views
    3,519

    Help with array def in different file

    I have a const char array defined in a .c file. I have a .h associated with the .c file included in my main file. Can i use that array in my main file? Do i have to define it in my main.c file and my...
  10. Replies
    5
    Views
    3,052

    I got it to work using fprintf(). The problem was...

    I got it to work using fprintf(). The problem was that there were newline characters inbetween some of the values
  11. Replies
    31
    Views
    6,762

    I agree, struct that contains first name, last...

    I agree, struct that contains first name, last name, and grade would be a better idea.
  12. Replies
    5
    Views
    3,052

    I have the struct to read in the header info from...

    I have the struct to read in the header info from the original file and to store it. I will read up about padding and alignment to see if that helps. Thanks.



    .pgm is an image file. Right now i...
  13. Replies
    5
    Views
    3,052

    Writing PGM header info to .pgm file

    I am having trouble writing the PGM header info to a new pgm file. When i do a hex dump of the first 20 bytes of the original and new header, i can see that "P5" is correct in both the original and...
  14. Replies
    8
    Views
    1,087

    Thanks for you help. It works if i put in another...

    Thanks for you help. It works if i put in another fscanf to check for any extra characters on the line.
  15. Replies
    8
    Views
    1,087

    Thanks. So since its trying to read the rest of...

    Thanks. So since its trying to read the rest of the line, how do i tell it to disregard that and start at the next line?
  16. Replies
    8
    Views
    1,087

    i thought that when i use the [^\n] in the fscanf...

    i thought that when i use the [^\n] in the fscanf statement, that reads until the newline even if the characters are not put in the array.
  17. Replies
    8
    Views
    1,087

    Im still a little confused. It reads in the line...

    Im still a little confused. It reads in the line of text, the first 79 characters. How do I get it to read in the next line the next time around the loop.

    Here is the text im trying to read in:
    ...
  18. Replies
    8
    Views
    1,087

    Need help with fscanf

    I created a function that reads in an int and a line of text. I read it into an array of size 80 so i only read in 79 characters. That part works, it will read in only 79 characters of a line of text...
  19. Replies
    8
    Views
    15,980

    Thanks for all the help. The reason i am using...

    Thanks for all the help. The reason i am using pointers instead of typical array reference is because i want to practice with pointers. Also when i was writing it, the toalpha function did not even...
  20. Replies
    8
    Views
    15,980

    changing array values using pointers

    I am trying to traverse an array of chars with pointers. Every x characters, i want to make it a capitalized character. I have a pointer to the array and the array. The pointer is set to a const...
Results 1 to 20 of 20