im reading in the input from a file one character at a time nd putting it on a table. i was going to find all the spaces between the and put the characters found up until that white space will be a...
Type: Posts; User: vidioholic
im reading in the input from a file one character at a time nd putting it on a table. i was going to find all the spaces between the and put the characters found up until that white space will be a...
ok thanx for the help! i figured id have to do that or create an actual string. i thought there might be a simpler way. thanks again though
if i put |n|i|c|e|\0| into a second array wouldnt it take up 5 elements in the array? this is an example of what i want it to look like:
char[0] = n;
char[1] = i;
char[2] = c;
char[3] = e;
...
i did do a search before. I didnt find anything that put characters together into words on another array
Hey guys, I am trying to take individual characters on an array and put them together into words on a new array. so if i have the word |n|i|c|e| in one array i want the other array to store the first...
you know what, right before i closed my laptop i noticed that and i tried it. it completely fixed my problem. i wasnt looking at the right queue. thanx for all your help tabstop!
*wheeew* ok
lets say there are 2 trains in the station. one of them leaves. now with that last train, i want to add a car to it. i am having two problems with this. first one is if i just...
ok but i dont understand how to send it to there and attach it to the train. also if i have a train depart, and add to the train under it, it just acts as if it is a new queue all together. should i...
ok i understand. wow its sooo good to see my queue in the stack for once. haha. well what do i do if i want to add a new car to the queue on the top of the stack?
why s->top-1?
i just have a feeling it has to do with the way the queue is being stacked. lets say we have 2 queues in the stack. if i pop the queue on top, and then try to add to the queue left over, it starts a...
do you want me to just post the entire thing so you can see what i have? i'll delete it after because it is for class. maybe there is more than one problem. i still have the same problem
oh ok ok i misunderstood you im sorry.
so you think it is stacking the right way, just not printing right? when i try and pop a queue, it erases one of the objects in the stack. i have another print statement to see what is in the queue i...
lol well how am i supposed to print the stack then? i was doing it like this:
int i;
for(i=0; i < s->top; i++)
printf("%s ", s->store[i]);
printf("\n");
ok here is how i am initiallizing the queue and adding a number to it:
struct queue* new_queue(int queue_size)
{
struct queue* q;
q = malloc(sizeof(struct queue));
i have a print function at so i can see what is being pushed. when i print s->store[s->top] i get weird figures or just simply <null>. do you think maybe it has to do with how i am initiallizing the...
i dont think the function is passing null is it?
//each time a new queue is added a new queue is created
q = new_queue(8);
printf("How many numbers...
im had a similar problem as miromage did a few posts back, except my stack IS storing queues. i'm pushing null into the stack for some reason though. i didnt want to post the same problem, but after...
ok thanks that really helped!
i seem to be having a problem printing a queue. when i dequeue, i am returning the value that was dequeued, and letting the user know when the queue is empty, but when i go to print the queue, the...
well i think i figured it out...
while(crnt->next != NULL && strcmp(license, crnt->next->license)!=0)
{
crnt = crnt->next;
return 0;
}
int removecar(struct cars** head, char* license)
{
struct cars* temp;
struct cars* crnt;
if((*head) == NULL)
return 0;
i had:
while(crnt->next != NULL && strcmp(license, crnt->next->license)!=0){
crnt = crnt->next;
if(crnt->next==NULL) //end of list reach and plate not found
...
ok but why is it deleting the second value in the list every time instead of the one i want?