Ooops. While I typed my lengthy update, Bayint posted a reply, which might've answered my new issues. Working on it now till I get new questions. Thanks Bayint!
Type: Posts; User: skytreader
Ooops. While I typed my lengthy update, Bayint posted a reply, which might've answered my new issues. Working on it now till I get new questions. Thanks Bayint!
Replies...
That solves my problems with math.h. Thank you.
I didn't know this but my main agenda is pthreads so it doesn't matter. Thank you for the info though.
Hi. I'm having compile errors with the following code which I cannot debug:
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define NTHREADS 32
Oh. Understood. Thanks.
However, I'm still confused as to your use of **.
& - gives the address of an object.
* - gives the object a pointer points to.
So if I declare a function
Hi all. I'm having problems with the pointers I pass to functions operating on a singly linked list. See:
typedef int ListElement;
typedef struct listnode ListNode;
typedef struct...
Yep. I noticed eventually and solved. I settled for a stack of pointers.
(And also, the most recent code I posted is a big mistake, I realized. The codes in my first post get more things done...
Salem. I think I get what you mean. In the next iteration, the contents of my local variables change and the contents of my stack as well. Hence, it goes well in the printf's but not afterwards.
...
Some further findings...
Since it seems like the problem occurrs after parse, I conducted some experiments on the printf's that followed (in my main function).
If I make the order of printf's...
Hi all. I'm creating binary trees from some given data. Afterwards, I need to traverse it in level order. However, my binary tree seems to get corrupted as my code moves on from line to line.
...
Oh...
That syntax pwned me real hard:confused:
Well, thanks hk_mp5kpdw.
Hi all. I am having a problem creating a stack for defined structures. I've created stacks in C before, but, until now, used them only for predefined data types like char. I want a stack for binary...
jeffcobb,
The way it sounds, memset() is the function I am looking for.
And, also, I wasn't trying to free anything in the code I gave. I was just looking at what arrays hold right after...
Hi all. Suppose I have a char array of size 3 with the following contents:
[a][b][\0]
where \0 is the null pointer. Is there a way that I can make the array become
[][b][\0]
In a moment's thought, I didn't realize that.
My apologies if my being stubborn caused inconveniences. Again, I did not use the working code given in our reference book because I wanted my own...
Hi quzah. I did that just to make sure that my stack doesn't return any machine-level-y error messages to the user. My StackUnderflow and StackOverflow do nothing but state the obvious (i.e. that a...
Hello. I've found a solution to my problem. Although satisfied that my pop works, it would still be nice if someone here can explain to me the difference I found.
My original test:
main(){...
Hello laserlight. I tried what you suggested and received the following output:
K
K
K
K
K
StackUnderflow occurred!
Hello. I have a question with my linked stack implementation in C. I'm pretty new to C and especially pointers. Any help will be greatly appreciated.
First of all, I tested my linked stack...
cas you got it all...much thanks. I'll have more light now in tackling this problem. Will try it out again as soon as I get some sleep...Again, thanks (--,)
Hello. I'm trying to learn C using K&R. I've had some background with Scheme and Java programming so I'm guessing that K&R is the path to take to learning C.
Earlier in the text, I wrote the...