Need for const in function argument list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux