From: Glynn Clements <glynn.clements@virgin.net>
To: adam@luchjenbroers.com
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Type conversion
Date: Fri, 28 Jun 2002 10:54:43 +0100 [thread overview]
Message-ID: <15644.12899.635930.540711@cerise.nosuchdomain.co.uk> (raw)
In-Reply-To: <20020628054419Z317059-685+171@vger.kernel.org>
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>
next prev parent reply other threads:[~2002-06-28 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-28 5:49 Type conversion Adam Luchjenbroers
2002-06-28 9:54 ` Glynn Clements [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2002-06-29 13:30 Graydon Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15644.12899.635930.540711@cerise.nosuchdomain.co.uk \
--to=glynn.clements@virgin.net \
--cc=adam@luchjenbroers.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).