OMG SO DUMB!
thank you so much!
Type: Posts; User: popapez
OMG SO DUMB!
thank you so much!
hey you :)
its right before the call to tokenize
new = (struct node*)malloc(sizeof(struct node*));
new = tokenize(line);
btw- i figured out the issue yesterday, thanks for your help.
I am getting a bus error with the following line of code (and presumably the 3 similar lines following it):
new->f1 = u;
this is my struct:
struct node // node for linked...
nothing has changed, same errors. :confused:
so this is the pointer?
struct node* tokenize(char line[])
{
.....
return new;
}
i do return the pointer from my tokenize function...
so, if we do these
struct node *new;
new = (struct node*)malloc(sizeof(struct node));
in main, just before pushing or enqueueing, will the memory stay allocated until the end of main?
I...
enqueue gets a bus error after this point, and I have no idea why.... end.next should be able to point to "new" and add new nodes this way...
void enqueue(void) // add number to queue
{...
Either I should not have left out this subroutine or it's just in the wrong place, but here are the important lines of tokenize:
struct node tokenize(char line[])
{
struct node *new;
new =...
well, *new = tokenize(line); will fill a node with the line from the file. Then when pushed or enqueued, it is manipulated to point to a new node, right?
Hi, I am taking a beginner's C programming course, although I am very fluent in java so I understand the concepts, etc.
I am implementing a stack and a queue with nodes of structs using linked...