Ok so that didn't work and I'm really not sure of anywhere else to go... Any other ideas of where it is wrong?
Type: Posts; User: Jailan
Ok so that didn't work and I'm really not sure of anywhere else to go... Any other ideas of where it is wrong?
So I would need to use something like:
treeNode* newNode(int number)
{
/* dynamicaly allocate memory for a treeNode
make sure it is initialised correctly
*/
We aren't allowed to change the structure of the code, we can only make it work so I have to use the loop unfortunately.
If I shifted the code around a little so that it was like below would that...
Hmm I changed that from != to == to stop the inifite "0" output. So I guess I would need to think of another way to get around that then...
I've got another error in the code somewhere but I can't figure out where it is.
At the moment when I run it I'm not getting any output, just a blank line.
I'm not to sure what the error is...
Thats it. Thanks.
Can anyone help with the below error, I'm not sure where I've gone wrong and why the pointer is wrong.
tree.c: In function 'freeTree':
tree.c:85: warning: initialization from incompatible pointer...
Thanks for your help it is working now. Thank you both.
Sorry I missed the edit on the other post of zacs7.
Thanks for your help I'm going to go back over it again now.
Sorry for any trouble.
openFile(filename, mode); ?
Sorry I'm a bit slow at the moment
How would I call the openFile()? Just like below?
int main(int argc, char *argv[])
{
if (argc != 2)
{
printf("Syntax : filecopy filefrom fileto");
I think so yeah. This is what I'm getting at the moment vs what I should be getting:
Your test result
Syntax : filecopy filefrom fileto
Expected result
We aren't meant to completely restructure the code unfortunately so I can't change the way it writes and reads.
Hey I need some help with the below code, it is an excercise for school but I can't work out the last part. I've debugged it as far as I can tell but it is meant to output a copy of the code when run...
Brilliant! Thanks!
Does anyone know what this might be caused by?
Undefined first referenced
symbol in file
main ...
Thanks heaps for your help mat! It is finally going ok! Sorry for all the trouble!
Oh ok I'll go put it back... Thanks.
ahhhh ok cheers!
Now I'm getting
"isb2.c", line 22: prototype mismatch: 0 args passed, 2 expected
"isb2.c", line 46: prototype mismatch: 0 args passed, 1 expected
I can't win!
Removed
Ignoring the over complicated stuff cause I just want it to work at the moment then I'll play around with it looking better... I tried declaring the two functions at the start but just got the below...
Removed
These are the errors I am getting back:
==> Your program only contains the main function
Your program must be split into appropriate functions
==> At least one function in your code must...
Thanks for your help I managed to nut it out after a while but I need some more help;
I need to split it up into seperate functions but each time I try I get a whole bunch of errors no matter what...
I am trying to understand it I just can't get my head around it sorry. I've never done any programming before this subject so it's a little tricky for me sorry.