User Profile
Collapse
-
Thanks a lot! That did the trick! I ended up just strcpy()ing it instead of strcat()ing. -
Program received signal SIGBUS, Bus error.
I have my c project which works fine and compiles fine on my home machine (MacBook Pro Mac OSX). When I upload it to my school server and compile it there it compiles but I get a bus error when I try option 2. My program gets graded on the school server, so its important I get it to compile lol. My school server is some sort of linux machine, not sure which.
I think the problem code is here:
...Code:head->paths[letter]
-
Creating tables through command line.
Usually I do all my table creating through PhpMyAdmin but I have a website on a different server that is only accessible through command prompt. The person who created my MySQL username gave me this command to connect to the database.
mysql -hmysql.ecn.purd ue.edu -Dhfh -uhfh -p
I opened up Terminal in mac and typed it in, just expecting it to work and get this error instead:
-bash: mysql: command not... -
You were right. c was type char. I attempted to create a string and still get a bus error. I also upped malloc to 2 instead of sizeof(char).
...Code:char cc[2]; cc[1] = '\0'; cc[0] = c; head->paths[letter] = (node *)malloc(sizeof(node)); head->paths[letter]->subExpressionTillNow = (char *)malloc(sizeof(head->subExpressionTillNow) + 2); head->paths[letter]->subExpressionTillNow
Leave a comment:
-
strcat causes bus error
Hey,
I have this struct
and this is the code thats giving me a bus error
Its a tree of binary letters, I load them in one character at a time. If the word is "STEVE" You create a node S which subExpressionTi llNow has value of "S". Then you create a node T which has a subexpressionti llnow of "ST".
Not working right, no clue whats wrong. Any...
No activity results to display
Show More
Leave a comment: