* Re: Type conversion
@ 2002-06-29 13:30 Graydon Smith
0 siblings, 0 replies; 7+ messages in thread
From: Graydon Smith @ 2002-06-29 13:30 UTC (permalink / raw)
To: linux-c-programming
Suriya Narayanan M S wrote:
>
>C++ (I don;t know the name)
>by Bjarne Stoustrup
>
Surprisingly enough, it too is called:
The C++ Programming Language
by Bjarne Stroustrup.
and I do believe the latest is the 3rd edition, but there maybe more.
--
Graydon Smith
"I never let my schooling interfere with my education."
- Mark Twain
^ permalink raw reply [flat|nested] 7+ messages in thread
* Type conversion
@ 2002-06-28 5:49 Adam Luchjenbroers
2002-06-28 9:54 ` Glynn Clements
0 siblings, 1 reply; 7+ messages in thread
From: Adam Luchjenbroers @ 2002-06-28 5:49 UTC (permalink / raw)
To: linux-c-programming
What are the C/C++ functions for converting between variable types.
ATM I need to be able to convert a long to an int. But I thought it would be
good to find out about the others while I'm here.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Type conversion
2002-06-28 5:49 Adam Luchjenbroers
@ 2002-06-28 9:54 ` Glynn Clements
2002-06-28 11:44 ` Adam Luchjenbroers
0 siblings, 1 reply; 7+ messages in thread
From: Glynn Clements @ 2002-06-28 9:54 UTC (permalink / raw)
To: adam; +Cc: linux-c-programming
Adam Luchjenbroers wrote:
> What are the C/C++ functions for converting between variable types.
>
> ATM I need to be able to convert a long to an int. But I thought it would be
> good to find out about the others while I'm here.
Conversion between numeric types is handled by "casts" (which are a
language feature) rather than explicit functions, i.e.
int i;
long l;
...
i = (int) l;
If you weren't aware of type casts, you probably need to get a book on
C.
You can't realistically learn a language from a combination of
trial-and-error and asking questions on mailing lists. Primarily
because, for many of the things which you need to learn, you won't
realise that you need to learn them until you've learnt them.
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Type conversion
2002-06-28 9:54 ` Glynn Clements
@ 2002-06-28 11:44 ` Adam Luchjenbroers
2002-06-28 14:16 ` Suriya Narayanan M S
2002-06-28 16:21 ` Marius Nita
0 siblings, 2 replies; 7+ messages in thread
From: Adam Luchjenbroers @ 2002-06-28 11:44 UTC (permalink / raw)
To: linux-c-programming
> If you weren't aware of type casts, you probably need to get a book on
> C.
Is there a good book you could recommend.
> You can't realistically learn a language from a combination of
> trial-and-error and asking questions on mailing lists. Primarily
> because, for many of the things which you need to learn, you won't
> realise that you need to learn them until you've learnt them.
I've learned alot from various projects where I've worked with code already
given to me and I've absorbed the techniques I've seen used. That said, there
would still be many techniques I don't know.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Type conversion
2002-06-28 11:44 ` Adam Luchjenbroers
@ 2002-06-28 14:16 ` Suriya Narayanan M S
2002-06-29 11:09 ` Flavio de Ayra Mendes
2002-06-28 16:21 ` Marius Nita
1 sibling, 1 reply; 7+ messages in thread
From: Suriya Narayanan M S @ 2002-06-28 14:16 UTC (permalink / raw)
To: linux-c-programming
On Friday 28 June 2002 17:14, Adam Luchjenbroers wrote:
> > If you weren't aware of type casts, you probably need to get a book on
> > C.
>
> Is there a good book you could recommend.
>
The C Programming Language (or some other name)
by Brian W. Kernighan and Dennis M. Ritchie
C++ (I don;t know the name)
by Bjarne Stoustrup
> > You can't realistically learn a language from a combination of
> > trial-and-error and asking questions on mailing lists. Primarily
> > because, for many of the things which you need to learn, you won't
> > realise that you need to learn them until you've learnt them.
>
> I've learned alot from various projects where I've worked with code already
> given to me and I've absorbed the techniques I've seen used. That said, there
> would still be many techniques I don't know.
Bye,
Suriya Narayanan M S
--
Guru Brahma Gurur Vishnu
Gurur Dhevo Maheshwaraha
Gurur Saakshaath Parabramha
Thasmai Shree Gurave Namaha
Public key at www.keyserver.net
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Type conversion
2002-06-28 11:44 ` Adam Luchjenbroers
2002-06-28 14:16 ` Suriya Narayanan M S
@ 2002-06-28 16:21 ` Marius Nita
1 sibling, 0 replies; 7+ messages in thread
From: Marius Nita @ 2002-06-28 16:21 UTC (permalink / raw)
To: Adam Luchjenbroers; +Cc: linux-c-programming
On Fri, Jun 28, 2002 at 09:14:23PM +0930, Adam Luchjenbroers wrote:
>
> > If you weren't aware of type casts, you probably need to get a book on
> > C.
>
> Is there a good book you could recommend.
K&R is pretty much the defacto standard for learning the language:
http://www.amazon.com/exec/obidos/ASIN/0131103628/qid=1025280640/sr=8-1/ref=sr_8_1/102-5246061-6069731
If you want a UNIX programming book in C:
http://www.amazon.com/exec/obidos/ASIN/0201563177/qid=1025281187/sr=1-1/ref=sr_1_1/102-5246061-6069731
> > You can't realistically learn a language from a combination of
> > trial-and-error and asking questions on mailing lists. Primarily
> > because, for many of the things which you need to learn, you won't
> > realise that you need to learn them until you've learnt them.
>
> I've learned alot from various projects where I've worked with code already
> given to me and I've absorbed the techniques I've seen used. That said, there
> would still be many techniques I don't know.
Casting is a very fundamental concept. :) Also, learning things in the wrong
order could hurt you later. Read a book; it's a good thing.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-06-29 13:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-29 13:30 Type conversion Graydon Smith
-- strict thread matches above, loose matches on Subject: below --
2002-06-28 5:49 Adam Luchjenbroers
2002-06-28 9:54 ` Glynn Clements
2002-06-28 11:44 ` Adam Luchjenbroers
2002-06-28 14:16 ` Suriya Narayanan M S
2002-06-29 11:09 ` Flavio de Ayra Mendes
2002-06-28 16:21 ` Marius Nita
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).