Click here to Skip to main content
15,902,032 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: System Sutdown and Start time Pin
ThatsAlok21-Aug-06 19:06
ThatsAlok21-Aug-06 19:06 
QuestionHow to create a table in the database using mfc Pin
vc++_fragrance21-Aug-06 2:29
vc++_fragrance21-Aug-06 2:29 
AnswerRe: How to create a table in the database using mfc Pin
Rage21-Aug-06 2:32
professionalRage21-Aug-06 2:32 
AnswerRe: How to create a table in the database using mfc Pin
_AnsHUMAN_ 21-Aug-06 2:46
_AnsHUMAN_ 21-Aug-06 2:46 
AnswerRe: How to create a table in the database using mfc Pin
Hamid_RT21-Aug-06 3:04
Hamid_RT21-Aug-06 3:04 
AnswerRe: How to create a table in the database using mfc Pin
David Crow21-Aug-06 3:37
David Crow21-Aug-06 3:37 
AnswerRe: How to create a table in the database using mfc Pin
vc++_fragrance21-Aug-06 22:53
vc++_fragrance21-Aug-06 22:53 
Question2d array problem in standard C Pin
bouli21-Aug-06 2:25
bouli21-Aug-06 2:25 
Hi gurus,

I have a problem here. I have forgotten how to pass a 2D array in a function Sigh | :sigh: . Normally an int** should do the deal, but no Frown | :(

Here is a sample code:
<br />
#include <stdio.h><br />
<br />
int				g_tab[16][4]=<br />
{<br />
	{ 0x03e0, 0x14a5, 0x0000, 0x0000, },<br />
	{ 0x7fff, 0x6739, 0x4e73, 0x18c6, },<br />
	{ 0x6460, 0x6431, 0x0821, 0x7bfe, },<br />
	{ 0x0000, 0x001f, 0x03e0, 0x7c00, },<br />
	{ 0x7fff, 0x7fff, 0x4631, 0x2529, },<br />
	{ 0x7fff, 0x4a52, 0x2d6b, 0x0000, },<br />
	{ 0x01e0, 0x0260, 0x0340, 0x0140, },<br />
	{ 0x7bff, 0x1ce8, 0x5294, 0x7fff, },<br />
<br />
	{ 0x67ff, 0x14a5, 0x56b5, 0x7fff, },<br />
	{ 0x7fff, 0x6739, 0x4e73, 0x18c6, },<br />
	{ 0x6460, 0x4631, 0x0821, 0x7bfe, },<br />
	{ 0x0000, 0x0000, 0x0000, 0x0000, },<br />
	{ 0x0000, 0x029d, 0x025b, 0x0195, },<br />
	{ 0x0000, 0x0131, 0x00cf, 0x0047, },<br />
	{ 0x0000, 0x01b6, 0x02df, 0x03e0, },<br />
	{ 0x68ba, 0x6660, 0x7c00, 0x3460, },<br />
};<br />
<br />
void Apply(int** tab)<br />
{<br />
	int				y=0, x=0;<br />
<br />
	for (y=0; y<16; y++)<br />
	{<br />
		for (x=0; x<4; x++)<br />
			printf("%d ", tab[y][x]);<br />
<br />
		printf("\n");<br />
	}<br />
}<br />
<br />
int main()<br />
{<br />
	Apply(g_tab);<br />
<br />
	return 0;<br />
}<br />


I don't see what's wrong with the code, but it crashes when calling tab[y][x]. Sniff | :^)

Can anybody help me and tell me what's wrong please?

Best regards.

Fred.



There is no spoon.

AnswerRe: 2d array problem in standard C Pin
toxcct21-Aug-06 2:37
toxcct21-Aug-06 2:37 
GeneralRe: 2d array problem in standard C Pin
bouli21-Aug-06 2:43
bouli21-Aug-06 2:43 
AnswerRe: 2d array problem in standard C Pin
prasad_som21-Aug-06 2:37
prasad_som21-Aug-06 2:37 
AnswerRe: 2d array problem in standard C Pin
Rage21-Aug-06 2:40
professionalRage21-Aug-06 2:40 
GeneralRe: 2d array problem in standard C Pin
bouli21-Aug-06 2:46
bouli21-Aug-06 2:46 
GeneralRe: 2d array problem in standard C Pin
Rage21-Aug-06 2:51
professionalRage21-Aug-06 2:51 
GeneralRe: 2d array problem in standard C Pin
Zac Howland21-Aug-06 3:43
Zac Howland21-Aug-06 3:43 
GeneralRe: 2d array problem in standard C Pin
Rage21-Aug-06 4:26
professionalRage21-Aug-06 4:26 
GeneralRe: 2d array problem in standard C Pin
fefe.wyx21-Aug-06 15:53
fefe.wyx21-Aug-06 15:53 
AnswerRe: 2d array problem in standard C Pin
Waldermort21-Aug-06 2:42
Waldermort21-Aug-06 2:42 
GeneralRe: 2d array problem in standard C Pin
bouli21-Aug-06 2:45
bouli21-Aug-06 2:45 
GeneralRe: 2d array problem in standard C Pin
Zac Howland21-Aug-06 6:24
Zac Howland21-Aug-06 6:24 
Questionto find the width and height of an rectangular object Image Pin
dinesh_IP21-Aug-06 1:59
dinesh_IP21-Aug-06 1:59 
AnswerRe: to find the width and height of an rectangular object Image Pin
Christian Graus21-Aug-06 2:16
protectorChristian Graus21-Aug-06 2:16 
GeneralRe: to find the width and height of an rectangular object Image Pin
Rage21-Aug-06 2:43
professionalRage21-Aug-06 2:43 
GeneralRe: to find the width and height of an rectangular object Image Pin
Christian Graus21-Aug-06 10:55
protectorChristian Graus21-Aug-06 10:55 
AnswerRe: to find the width and height of an rectangular object Image Pin
Rage21-Aug-06 2:48
professionalRage21-Aug-06 2:48 

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.