From: Shriramana Sharma <samjnaa@gmail.com>
To: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Need for const in function argument list
Date: Sun, 26 Mar 2006 16:14:39 +0530 [thread overview]
Message-ID: <200603261614.39708.samjnaa@gmail.com> (raw)
In the Qt constructor for the DateTime class, I see:
QDateTime::QDateTime(const QDate &date)
what is the need for the keyword const here? If it is to indicate that the
date variable does not change, then in very many such places should the const
keyword be used. But it is not.
As a related question, in the syntax for printf, we have printf(const char
*format) -- why should we have const here?
--
Tux #395953 resides at http://samvit.org
playing with KDE 3.51 on SUSE Linux 10.0
$ date [] CCE +2006-03-26 W12-7 UTC+0530
next reply other threads:[~2006-03-26 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-26 10:44 Shriramana Sharma [this message]
2006-03-26 10:57 ` Need for const in function argument list Steve Graegert
2006-03-26 13:38 ` Shriramana Sharma
2006-03-26 15:38 ` Steve Graegert
2006-03-26 16:27 ` Glynn Clements
2006-03-27 8:25 ` Yorgos Pagles
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=200603261614.39708.samjnaa@gmail.com \
--to=samjnaa@gmail.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).