Click here to Skip to main content
16,004,806 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWM_QUERYENDSESSION From a dll Pin
AssemblySoft1-Sep-04 23:25
AssemblySoft1-Sep-04 23:25 
Generalpressed button sends message Pin
Tibor Blazko1-Sep-04 22:57
Tibor Blazko1-Sep-04 22:57 
GeneralHelp me!!!!! Pin
Anonymous1-Sep-04 22:44
Anonymous1-Sep-04 22:44 
GeneralSQL_ATTR_CONNECTION_DEAD attribute of MySQL not working as expected Pin
Anonymous1-Sep-04 22:37
Anonymous1-Sep-04 22:37 
GeneralPointer array access outside a class! Pin
CreepingFeature1-Sep-04 22:06
CreepingFeature1-Sep-04 22:06 
GeneralRe: Pointer array access outside a class! Pin
Mike Beckerleg1-Sep-04 22:35
Mike Beckerleg1-Sep-04 22:35 
GeneralRe: Pointer array access outside a class! Pin
Anonymous2-Sep-04 2:20
Anonymous2-Sep-04 2:20 
GeneralRe: Pointer array access outside a class! Pin
Mike Beckerleg2-Sep-04 3:09
Mike Beckerleg2-Sep-04 3:09 
I'm a bit confused about what you are trying to achieve but here goes.

If your class contains an array of values that you want to be able to access then write an operator[] method such as:

<br />
class SomeClass<br />
{<br />
public:<br />
  // construction and stuff here<br />
<br />
  const double& operator[](const int index) const<br />
  {<br />
    return mArray[index];<br />
  }<br />
<br />
  double& operator[](const int index)<br />
  {<br />
    return mArray[index];<br />
  }<br />
<br />
private:<br />
  double mArray[30];<br />
};<br />


Obviously you would put in some sort of bounds checking on the index value.

However from what you are saying the values you are trying to access are not currently in an array, why not? What are these data items? It sounds like they are unrelated items and you just want the array to save having to write accessor methods. If that is the case you may as well just make them public Dead | X| which is what your method would do!
GeneralRe: Pointer array access outside a class! Pin
CreepingFeature2-Sep-04 21:00
CreepingFeature2-Sep-04 21:00 
GeneralZIP files programmatically using MFC C++ Pin
anderslundsgard1-Sep-04 20:37
anderslundsgard1-Sep-04 20:37 
GeneralRe: ZIP files programmatically using MFC C++ Pin
PJ Arends1-Sep-04 21:18
professionalPJ Arends1-Sep-04 21:18 
GeneralControlling Device and Internet Pin
zahid_ash1-Sep-04 19:46
zahid_ash1-Sep-04 19:46 
GeneralEdit Box messages Pin
shiraztk1-Sep-04 19:21
shiraztk1-Sep-04 19:21 
GeneralRe: Edit Box messages Pin
Scozturk1-Sep-04 21:45
professionalScozturk1-Sep-04 21:45 
GeneralRe: Edit Box messages Pin
shiraztk1-Sep-04 22:27
shiraztk1-Sep-04 22:27 
GeneralRe: Edit Box messages Pin
wb2-Sep-04 0:52
wb2-Sep-04 0:52 
GeneralRe: Edit Box messages Pin
James R. Twine2-Sep-04 3:48
James R. Twine2-Sep-04 3:48 
GeneralRe: Edit Box messages Pin
shiraztk2-Sep-04 20:16
shiraztk2-Sep-04 20:16 
GeneralMessge routing in SDI/MDI Pin
vikramlinux1-Sep-04 19:02
vikramlinux1-Sep-04 19:02 
Questionanybody has experience of using Nero SDK? Pin
lonely_life1-Sep-04 18:59
lonely_life1-Sep-04 18:59 
Generalscanlogd Pin
Anonymous1-Sep-04 18:58
Anonymous1-Sep-04 18:58 
GeneralOnLButtonDown() question Pin
persian_boi1-Sep-04 17:40
persian_boi1-Sep-04 17:40 
GeneralRe: OnLButtonDown() question Pin
Michael Dunn1-Sep-04 18:00
sitebuilderMichael Dunn1-Sep-04 18:00 
GeneralRe: OnLButtonDown() question Pin
Antony M Kancidrowski2-Sep-04 1:07
Antony M Kancidrowski2-Sep-04 1:07 
GeneralVideo Editing of .avi & .mpegs files Pin
defused1-Sep-04 17:09
defused1-Sep-04 17:09 

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.