For Programmers: Free Programming Magazines  


Home > Archive > C > February 2006 > meaning of these symbol?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author meaning of these symbol?
newbie

2006-02-26, 6:55 pm

i'm a newbie for c programming.
Anyone can tell me what the meaning of '<<', '>>', '&' and ' | '?

jamx

2006-02-26, 6:55 pm

These symbols are bitwise operators.

& = AND

| = OR

<< = left shift
[color=darkred]

If you want to know what these operators do, i suggest you to read
http://www.cs.cf.ac.uk/Dave/C/node1...000000000000000

newbie

2006-02-26, 6:55 pm

thanks :)
how about this ' ->' ?

jamx

2006-02-26, 6:55 pm

The -> symbol points to the member of some object/struct.
Like: myObject->value = 1;

CBFalconer

2006-02-26, 6:55 pm

jamx wrote:
>
> The -> symbol points to the member of some object/struct.
> Like: myObject->value = 1;


No it doesn't. It dereferences a pointer to a struct (or union)
and then selects the appropriate member. To select the member of a
struct use the '.' operator.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>

Default User

2006-02-26, 6:55 pm

newbie wrote:

> i'm a newbie for c programming.
> Anyone can tell me what the meaning of '<<', '>>', '&' and ' | '?


This is no way to learn C. Get a good book on the subject.



Brian

--
If televison's a babysitter, the Internet is a drunk librarian who
won't shut up.
-- Dorothy Gambrell (http://catandgirl.com)
Neil

2006-02-27, 3:57 am

jamx wrote:
> These symbols are bitwise operators.
>
> & = AND
>
> | = OR
>
> << = left shift
>
>
> If you want to know what these operators do, i suggest you to read
> http://www.cs.cf.ac.uk/Dave/C/node1...000000000000000
>


& = BITWISE AND
| = BITWISE OR
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com