Click here to Skip to main content
15,922,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Why LoadMenu() Failed! Errorcode=1814 Pin
David Crow2-Sep-04 3:00
David Crow2-Sep-04 3:00 
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 
Mike Beckerleg wrote:
This is wrong in so many ways.

You are right!

But I found the code bellow to work just right:

void arrayAddressFunct(int *array[], int index)<br />
{<br />
	cout << endl;<br />
	cout << " Array address: " << array;<br />
	cout << endl;<br />
	cout << " Array access through address at index: " << *array[index];<br />
};


If the pointerArray address is passed to first argument and the desired index to the second then the function has access to the array at any index. It can actualy be used to return/change the values pointed to by the array.

This is what I wanted to do in the first place.

A question though: Is it a good idea to do the following?

Say a got a class/etc. containing a bunch of variables and I declare an array pointing to those variables. Then I write a two members which when accessed outside of the class Big Grin | :-D in the form described by the code above can change and return the variables pointed to thru the array.

Or is there a better way to keep the variables safe but still have access to them without having to write a pile of members for access/change/return of the values.
GeneralRe: Pointer array access outside a class! Pin
Mike Beckerleg2-Sep-04 3:09
Mike Beckerleg2-Sep-04 3:09 
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 

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.