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...
Type: Posts; User: dford425
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...
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...
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...
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....
Thanks for the quick replys, fflush() worked.
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...
That worked, thank you.
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’...
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...
I got it to work using fprintf(). The problem was that there were newline characters inbetween some of the values
I agree, struct that contains first name, last name, and grade would be a better idea.
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...
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...
Thanks for you help. It works if i put in another fscanf to check for any extra characters on the line.
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?
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.
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:
...
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...
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...
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...