Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: stuck with a trivia Pin
Stuart Dootson3-Feb-09 22:01
professionalStuart Dootson3-Feb-09 22:01 
GeneralRe: stuck with a trivia Pin
Smith#3-Feb-09 22:14
Smith#3-Feb-09 22:14 
GeneralRe: stuck with a trivia Pin
Smith#3-Feb-09 22:18
Smith#3-Feb-09 22:18 
AnswerRe: stuck with a trivia Pin
Emilio Garavaglia3-Feb-09 23:13
Emilio Garavaglia3-Feb-09 23:13 
GeneralRe: stuck with a trivia Pin
Smith#4-Feb-09 7:44
Smith#4-Feb-09 7:44 
GeneralRe: stuck with a trivia [modified] Pin
Emilio Garavaglia4-Feb-09 21:32
Emilio Garavaglia4-Feb-09 21:32 
GeneralRe: stuck with a trivia Pin
Smith#7-Feb-09 16:13
Smith#7-Feb-09 16:13 
GeneralRe: stuck with a trivia Pin
Emilio Garavaglia4-Feb-09 21:52
Emilio Garavaglia4-Feb-09 21:52 
Now, let's move a little bit on:

If you agree with my previous post, consider this:
int a [2][2] = { 1,2,3,4 }; 
int[2]* ppa = a;


Do you get it? Instead of int**, I use int[2]*: a "pointer to an array of two integers". considering the int[][] as "array of 2 arrays of two integers".
The type of int** is int* (that doesn't exist in memory since we store arrays), but the value of int[2]* is int[2] that's just one row of the matrix ( in our case
{{1,2},{3,4}}

Now ppa[1][1] is "take the address stored in ppa, add 1*sizeof(int[2]). This is the int[2] representing the second row. Now we're anymore dealing with a pointer, but with an array, whose cell "1" has the value "4".


2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


Questionfatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h></windows.h> [modified] Pin
Kiran Pinjala3-Feb-09 19:38
Kiran Pinjala3-Feb-09 19:38 
AnswerRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
SandipG 3-Feb-09 20:49
SandipG 3-Feb-09 20:49 
GeneralRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
Kiran Pinjala3-Feb-09 21:32
Kiran Pinjala3-Feb-09 21:32 
AnswerRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
«_Superman_»3-Feb-09 20:59
professional«_Superman_»3-Feb-09 20:59 
GeneralRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
Kiran Pinjala3-Feb-09 21:34
Kiran Pinjala3-Feb-09 21:34 
GeneralRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
Smith#3-Feb-09 21:44
Smith#3-Feb-09 21:44 
GeneralRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
Kiran Pinjala3-Feb-09 22:24
Kiran Pinjala3-Feb-09 22:24 
QuestionRe: fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include Pin
David Crow4-Feb-09 3:32
David Crow4-Feb-09 3:32 
QuestiontimeSetEvent only in Windows XP? Pin
nm_1143-Feb-09 19:25
nm_1143-Feb-09 19:25 
AnswerRe: timeSetEvent only in Windows XP? Pin
Stuart Dootson3-Feb-09 21:14
professionalStuart Dootson3-Feb-09 21:14 
QuestionEnsuring DialogBox is fully initialized Pin
prashantbhatia0073-Feb-09 19:03
prashantbhatia0073-Feb-09 19:03 
AnswerRe: Ensuring DialogBox is fully initialized Pin
SandipG 3-Feb-09 20:51
SandipG 3-Feb-09 20:51 
AnswerRe: Ensuring DialogBox is fully initialized Pin
prasad_som4-Feb-09 0:48
prasad_som4-Feb-09 0:48 
AnswerRe: Ensuring DialogBox is fully initialized Pin
Iain Clarke, Warrior Programmer4-Feb-09 1:28
Iain Clarke, Warrior Programmer4-Feb-09 1:28 
Questiondrives list Pin
K. Sushilkumar3-Feb-09 18:44
K. Sushilkumar3-Feb-09 18:44 
AnswerRe: drives list Pin
«_Superman_»3-Feb-09 20:56
professional«_Superman_»3-Feb-09 20:56 
QuestionSocket programming Pin
Member 46946273-Feb-09 18:25
Member 46946273-Feb-09 18:25 

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.