Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/06/07 12:07
Read: times


 
#142809 - C++ ?
Responding to: ???'s previous message
Oliver Sedlacek said:
I've been reading the C++ FAQs book, so I'm a convert to the concept of "const correctness"

I don't know, but isn't 'const' one of the areas where C++ is quite significantly different from plain ANSI 'C'?

In plain ANSI 'C', the 'const' qualifier is really quite weak - the only requirement is that the compiler gives a message if it can detect an attempt to write to a 'const' item.

But I agree with the principle: always give the compiler as much help as you can - so, if you intend that an item should be read-only, why would you not give it the 'const' qualifier?



List of 22 messages in thread
TopicAuthorDate
A Simpler Way?            01/01/70 00:00      
   Logical AND ?            01/01/70 00:00      
   Shift?            01/01/70 00:00      
      I Agree.            01/01/70 00:00      
   Another Option            01/01/70 00:00      
   the simplest way            01/01/70 00:00      
      capitals            01/01/70 00:00      
         I copyued what the OP used            01/01/70 00:00      
         The common use of CAPs in C            01/01/70 00:00      
            totally agree, however            01/01/70 00:00      
               Why are you rambling about variables...            01/01/70 00:00      
                  not to me            01/01/70 00:00      
         Variable capitalisation?            01/01/70 00:00      
            'code 'never is            01/01/70 00:00      
               Did not think it mattered.            01/01/70 00:00      
               Code modifier            01/01/70 00:00      
                  both            01/01/70 00:00      
                     Use both            01/01/70 00:00      
                        C++ ?            01/01/70 00:00      
                           Mixed            01/01/70 00:00      
                        Extensions            01/01/70 00:00      
                           Experience            01/01/70 00:00      

Back to Subject List