Click here to Skip to main content
15,928,207 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Define BIT level Struct Pin
Serge Krynine22-May-03 19:22
Serge Krynine22-May-03 19:22 
GeneralRe: Define BIT level Struct Pin
basementman23-May-03 4:14
basementman23-May-03 4:14 
QuestionNTFS file tagging? Pin
rcsj122-May-03 15:38
rcsj122-May-03 15:38 
AnswerRe: NTFS file tagging? Pin
Michael Dunn22-May-03 18:52
sitebuilderMichael Dunn22-May-03 18:52 
GeneralSplit String Question.... Pin
Nitron22-May-03 13:49
Nitron22-May-03 13:49 
GeneralRe: Split String Question.... Pin
Joaquín M López Muñoz22-May-03 20:05
Joaquín M López Muñoz22-May-03 20:05 
GeneralRe: Split String Question.... Pin
Nitron23-May-03 2:16
Nitron23-May-03 2:16 
Question"const int" or "int const" ? Pin
Gavin Greig22-May-03 12:57
Gavin Greig22-May-03 12:57 
Both the following are valid C++ and have the same meaning:

const int i = 0;
int const j = 0;

The first style is widely used, and everyone will recognise and understand it. The second style is not so immediately understandable to most developers. However, always putting the const qualifier immediately to the right of what it qualifies can prevent some esoteric bugs. There's a brief discussion of why, with examples, here[^], in the section titled Avoiding confusion by using a good programming style. I only found a few other examples when I searched a few weeks ago, so it's safe to assume the second method is not widely known.

In your opinion, is the safer, but less well-known and understood style "better" than the widely-used one, or not?

For what it's worth, I think the safer style is "better", but obviously changing such a deeply engrained style across a development team or organisation is likely to prove difficult.

Gavin Greig

"Haw, you're no deid," girned Charon. "Get aff ma boat or ah'll report ye."
Matthew Fitt - The Hoose O Haivers: The Twelve Trauchles O Heracles.

AnswerRe: "const int" or "int const" ? Pin
Michael Dunn22-May-03 18:57
sitebuilderMichael Dunn22-May-03 18:57 
GeneralRe: "const int" or "int const" ? Pin
Gavin Greig22-May-03 22:58
Gavin Greig22-May-03 22:58 
Generalvswprintf Pin
Matt Newman22-May-03 12:57
Matt Newman22-May-03 12:57 
GeneralRe: vswprintf Pin
cmk22-May-03 14:45
cmk22-May-03 14:45 
GeneralRe: vswprintf Pin
Matt Newman22-May-03 16:54
Matt Newman22-May-03 16:54 
GeneralRe: vswprintf Pin
cmk23-May-03 8:18
cmk23-May-03 8:18 
QuestionGetting WebBrowser app to use Sun's VM? Pin
gmontem22-May-03 12:20
gmontem22-May-03 12:20 
GeneralRich Edit control programming in C Pin
SAK22-May-03 11:32
SAK22-May-03 11:32 
GeneralRe: Rich Edit control programming in C Pin
jhaga22-May-03 12:04
professionaljhaga22-May-03 12:04 
GeneralRe: Rich Edit control programming in C Pin
SAK23-May-03 5:35
SAK23-May-03 5:35 
GeneralValidate a filename Pin
JC Gauthier22-May-03 10:35
JC Gauthier22-May-03 10:35 
GeneralRe: Validate a filename Pin
valikac22-May-03 11:16
valikac22-May-03 11:16 
GeneralRe: Validate a filename Pin
Anonymous23-May-03 3:32
Anonymous23-May-03 3:32 
GeneralRe: Validate a filename Pin
valikac23-May-03 4:11
valikac23-May-03 4:11 
GeneralRe: Validate a filename Pin
gmontem22-May-03 12:17
gmontem22-May-03 12:17 
GeneralEAP dll, IEAPProviderConfig and samples Pin
aguacate22-May-03 10:25
aguacate22-May-03 10:25 
GeneralImage Magick Demo project Pin
tulip_tulip6822-May-03 9:54
tulip_tulip6822-May-03 9:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.