Click here to Skip to main content
15,916,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAdd text to title bar (or document header) Pin
AeJai6-Aug-07 8:09
AeJai6-Aug-07 8:09 
AnswerRe: Add text to title bar (or document header) Pin
Mark Salsbery6-Aug-07 8:11
Mark Salsbery6-Aug-07 8:11 
GeneralRe: Add text to title bar (or document header) Pin
AeJai6-Aug-07 8:14
AeJai6-Aug-07 8:14 
QuestionRe: Add text to title bar (or document header) Pin
AeJai6-Aug-07 9:39
AeJai6-Aug-07 9:39 
AnswerRe: Add text to title bar (or document header) Pin
Mark Salsbery6-Aug-07 9:59
Mark Salsbery6-Aug-07 9:59 
Question2 dim numbers.. Pin
_80866-Aug-07 5:42
_80866-Aug-07 5:42 
QuestionRe: 2 dim numbers.. Pin
David Crow6-Aug-07 5:44
David Crow6-Aug-07 5:44 
AnswerRe: 2 dim numbers.. Pin
_80866-Aug-07 6:20
_80866-Aug-07 6:20 
Thanks atlast got a reply.
No I'm not simply wanting a 2D Array.

An array is a group of memory locations that we reserve, Ok in the below statement, I've reserved. 6 Memory locations that has the capability to store 6 integers. And I've got a pointer pointing to that.

int* pInt = new int[2*3];

The dimension. It's how we look at the reserved memory location.
The memory as of now, looks like :
[] [] [] [] [] []
^
Incrementing the pInt's value would make it go like :
[] [] [] [] [] []
-+^
[] [] [] [] [] []
---++^
This is linear. We can do the same with pInt[0],[1]..etc. Ok this about looking at the memory locations in 1D.

Now I want to look at it in 2D.
The same memory location.

I would want to initialize a 2D pointer to the same memory location.
Where I should be able to mention 2 indices. You may take it as 2x3 or 3x2

when you say 2x3,
That says, 2 rows and 3 elements in each row.
[] [] []
[] [] []

Now tell me how should declare a pointer to the memory location that it would access them as 2D.

int* pInt = new int[2*3];
int(** ptr2D)[2][3] = new int*[2]; <--something like this. NOT SURE.

If we are gonna look at the same memory locations as 3x2,
then it becomes.
[] []
[] []
[] []

Here ptr2D[2][0].. would make sense. Because, The number of rows, 0th row, 1th row, 2nd row. Has 3 rows. But in the former case, it would crash because we were looking at it as 2 rows with 3 columns.

My question makes sense?



----------------------------
286? WOWW!Blush | :O

GeneralRe: 2 dim numbers.. Pin
David Crow6-Aug-07 7:24
David Crow6-Aug-07 7:24 
GeneralRe: 2 dim numbers.. Pin
_80866-Aug-07 7:42
_80866-Aug-07 7:42 
AnswerRe: 2 dim numbers.. Pin
Rage6-Aug-07 5:49
professionalRage6-Aug-07 5:49 
GeneralRe: 2 dim numbers.. Pin
_80866-Aug-07 6:27
_80866-Aug-07 6:27 
GeneralRe: 2 dim numbers.. Pin
_80866-Aug-07 6:41
_80866-Aug-07 6:41 
GeneralRe: 2 dim numbers.. Pin
Rage6-Aug-07 21:01
professionalRage6-Aug-07 21:01 
AnswerRe: 2 dim numbers.. Pin
Mark Salsbery6-Aug-07 7:13
Mark Salsbery6-Aug-07 7:13 
QuestionWinExec return value, Createprocess return value? VC++ 6.0 Pin
rolfhorror6-Aug-07 5:34
rolfhorror6-Aug-07 5:34 
AnswerRe: WinExec return value, Createprocess return value? VC++ 6.0 Pin
Rage6-Aug-07 5:40
professionalRage6-Aug-07 5:40 
AnswerRe: WinExec return value, Createprocess return value? VC++ 6.0 Pin
David Crow6-Aug-07 5:43
David Crow6-Aug-07 5:43 
QuestionPassing a Windows data type results in a liner error [modified] Pin
Cuziyq6-Aug-07 5:27
Cuziyq6-Aug-07 5:27 
AnswerRe: Passing a Windows data type results in a liner error Pin
Mark Salsbery6-Aug-07 5:51
Mark Salsbery6-Aug-07 5:51 
GeneralRe: Passing a Windows data type results in a liner error Pin
Cuziyq6-Aug-07 6:02
Cuziyq6-Aug-07 6:02 
QuestionHow to strip debug info from an executable on Vista using VS 2005 Pin
Ben Burnett6-Aug-07 5:04
Ben Burnett6-Aug-07 5:04 
QuestionVC5 DLL migration to VC8 Pin
Nitin_A6-Aug-07 4:58
Nitin_A6-Aug-07 4:58 
QuestionLINK error1181:Cann't open input file "Gx.obj" Pin
kcynic6-Aug-07 4:56
kcynic6-Aug-07 4:56 
AnswerRe: LINK error1181:Cann't open input file "Gx.obj" Pin
toxcct6-Aug-07 5:37
toxcct6-Aug-07 5:37 

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.