linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Need for const in function argument list
@ 2006-03-26 10:44 Shriramana Sharma
  2006-03-26 10:57 ` Steve Graegert
  0 siblings, 1 reply; 6+ messages in thread
From: Shriramana Sharma @ 2006-03-26 10:44 UTC (permalink / raw)
  To: Linux C Programming List

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-03-27  8:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-26 10:44 Need for const in function argument list Shriramana Sharma
2006-03-26 10:57 ` 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

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).