Click here to Skip to main content
15,798,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDirectShow VMR-9: renders only 50% of the time in fullscreen. how to fix? Pin
Satrugha4-Nov-09 14:38
Satrugha4-Nov-09 14:38 
Questionhow to declare a one based array ? Pin
timbk4-Nov-09 13:47
timbk4-Nov-09 13:47 
AnswerRe: how to declare a one based array ? Pin
Luc Pattyn4-Nov-09 14:25
sitebuilderLuc Pattyn4-Nov-09 14:25 
AnswerRe: how to declare a one based array ? [modified] Pin
CPallini4-Nov-09 14:35
mveCPallini4-Nov-09 14:35 
GeneralRe: how to declare a one based array ? Pin
timbk4-Nov-09 14:43
timbk4-Nov-09 14:43 
QuestionRe: how to declare a one based array ? Pin
CPallini4-Nov-09 14:49
mveCPallini4-Nov-09 14:49 
AnswerRe: how to declare a one based array ? Pin
timbk4-Nov-09 14:58
timbk4-Nov-09 14:58 
GeneralRe: how to declare a one based array ? Pin
CPallini4-Nov-09 21:54
mveCPallini4-Nov-09 21:54 
I'm sorry for you.

C/C++ arrays are zero based.
While there's nothing wrong in liking better one-based arrays, it is wiser remaining stuck with zero-based ones, because:
  • You need extra work to make your arrays alive (extra work is generally bad)
  • Most people use the opposite convention: that means you have to adapt your data to any time you've to deal with other people code, like libraries, etc..

Neverthless, there are few examples of consistently used one-based arrays, for instance, all "Numerical Recipes" book source code uses it (the authors simply ignore array item 0).
Like all 'alien' conventions it's a bit difficult to grasp immediately, but after some experience with, becomes 'natural'.

Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: how to declare a one based array ? Pin
Tim Craig4-Nov-09 14:43
Tim Craig4-Nov-09 14:43 
GeneralRe: how to declare a one based array ? Pin
timbk4-Nov-09 14:52
timbk4-Nov-09 14:52 
GeneralRe: how to declare a one based array ? Pin
Tim Craig4-Nov-09 20:00
Tim Craig4-Nov-09 20:00 
GeneralRe: how to declare a one based array ? Pin
Chris Losinger5-Nov-09 3:11
professionalChris Losinger5-Nov-09 3:11 
GeneralRe: how to declare a one based array ? Pin
Tim Craig5-Nov-09 20:51
Tim Craig5-Nov-09 20:51 
QuestionHow to convert "wistream" to "istream" Pin
transoft4-Nov-09 12:59
transoft4-Nov-09 12:59 
AnswerRe: How to convert "wistream" to "istream" Pin
«_Superman_»4-Nov-09 13:38
professional«_Superman_»4-Nov-09 13:38 
GeneralRe: How to convert "wistream" to "istream" Pin
transoft4-Nov-09 13:42
transoft4-Nov-09 13:42 
GeneralRe: How to convert "wistream" to "istream" Pin
«_Superman_»4-Nov-09 14:02
professional«_Superman_»4-Nov-09 14:02 
QuestionSSE3 Intrinsic in g++ Pin
godot_gildor4-Nov-09 11:56
godot_gildor4-Nov-09 11:56 
AnswerRe: SSE3 Intrinsic in g++ Pin
godot_gildor4-Nov-09 16:35
godot_gildor4-Nov-09 16:35 
GeneralRe: SSE3 Intrinsic in g++ Pin
Luc Pattyn4-Nov-09 16:48
sitebuilderLuc Pattyn4-Nov-09 16:48 
GeneralRe: SSE3 Intrinsic in g++ Pin
godot_gildor4-Nov-09 16:57
godot_gildor4-Nov-09 16:57 
QuestionCSocket and "Socket Notification Sink" exception Pin
includeh104-Nov-09 11:35
includeh104-Nov-09 11:35 
AnswerRe: CSocket and "Socket Notification Sink" exception Pin
Richard Andrew x644-Nov-09 15:52
professionalRichard Andrew x644-Nov-09 15:52 
GeneralRe: CSocket and "Socket Notification Sink" exception Pin
Rajesh R Subramanian4-Nov-09 21:26
professionalRajesh R Subramanian4-Nov-09 21:26 
Question[Message Deleted] Pin
includeh104-Nov-09 10:47
includeh104-Nov-09 10:47 

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.