1. the arrow thing.. ->

mm...what does the arrow thing do? lol i dont know what its called..therefore i have no clue what i'd search in google. i'm sure "the arrow thing" wouldn't come up with anything i'd be interested in.. example:
Code:
else if ( header->data != search_key ) {
int dir = header->data < search_key;
}
thats from the binary search tutorial and i dont know what its doing so its kind of hard to understand whats going on..

also - how do you use the question mark? like i know its supposed to be a conditional, but what does it test?

thanks

2. x->y means dereference x and refer to the field within the struct which x points to known as y, where x is a pointer to a struct, and y is a field within that struct.

It is shorthand for (*(x)).y

To attempt to clarify:
Code:
struct foo {
int bar;
};

/* ... */

struct foo baz;
struct foo *p;

p = &baz; /* now p points to baz */

p->bar; /* this refers to baz.bar */
a ? b : c means evaluate a, if a is true, evaluate b, if a is false, evaluate c.

3. So let's get this straight. You're going to code for food, but you don't know what the conditional operator or the arrow operator do? Good grief. Buy a book.

Quzah.

4. thanks cwr.

going to being your key words quzah ;]
i dont like to buy books. they cost money and i dont read them. lol

5. i dont like to buy books. they cost money and i dont read them. lol
Start.

6. i dont find they help me. i learn better from sample code and explanations of it.
i took a c/c++ class at the college i go to and opened the book (b/c we had to in class) all of 5 times. i also tried reading it once or twice..didn't help.
plus buying books is more expensive than reading online documentation. ..in a way..not if you substitute the cost of the internet for the cost of the books, but i<3myinternet lol

7. Originally Posted by willc0de4food
i dont find they help me. i learn better from sample code and explanations of it.
Guess what programming books are generally full of? Hint: Sample code, and explanations of it.

8. i know. the book i had was called "C How to Program"

9. Pointer trouble.

sorry..

10. >thats from the binary search tutorial and i dont know what its doing
That's funny, most people ask "what's up with that dir thingy?". By the way, that tutorial is out of date. The current version can be found on my website, but be sure to save it if you want to complete it. I'm working on a complete rewrite that will improve the entire tutorials by leaps and bounds.

>i dont like to buy books. they cost money and i dont read them.
Think of books as an investment. I have several books that contain information that I have yet to see elsewhere, and they'll remain a valuable reference for as long as I continue programming. While you can learn to write good code just by looking at good code and talking to people, it's best to gather information from as many sources as possible.

>i learn better from sample code and explanations of it.
Don't we all? But at some point you'll find that you understand the syntax and semantics of the language, and just reading code and explanations of it won't give you enough insight into the logic behind the solution. When that happens, you'll be forced to drop more into theory to figure out what's going on, and the best way to do that is through books.

11. Originally Posted by nkhambal
sorry..
???

mm...prelude, what are some good books? right now i'm especially curious about binary searches / search trees / linked lists / hash tables. but also good books that are just juicy with good info :]
and i like your website, it has good information.
i'm using some of the info you have on random numbers and it works well thanks.

12. ...

Ah, nice site you got there Prelude. I Never knew you were a women. I always presume everyone on here, or in any other forum for that matter, that programmers are males. Which is true in most cases but this is a surprise. Anyway, I'm happy I stumbled upon your site because it has a lot of tutorials I've been wanting to indulge myself in. Thanks for the link.

[p.s, You're a pretty women =P ]

13. And since nobody did it yet: the -> operator is called the "indirect member access" operator.
Or something very similar.

14. Originally Posted by CornedBee
And since nobody did it yet: the -> operator is called the "indirect member access" operator.
Or something very similar.
haha thanks.

15. Originally Posted by Prelude
>thats from the binary search tutorial and i dont know what its doing
That's funny, most people ask "what's up with that dir thingy?". By the way, that tutorial is out of date. The current version can be found on my website, but be sure to save it if you want to complete it. I'm working on a complete rewrite that will improve the entire tutorials by leaps and bounds...
mm..Prelude ? why would completing the tutorial now make sense if your going to update it and its going to be better? lol it seems to me that the better choice would be to wait until the update and THEN go through the tutorial...? lol idk, maybe its just me but..

unless its going to be like, a month before the update. lol ?