Click here to Skip to main content
15,912,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with CPU Usage Pin
Cedric Moonen14-Nov-07 0:01
Cedric Moonen14-Nov-07 0:01 
GeneralRe: Problem with CPU Usage Pin
Cedric Moonen13-Nov-07 22:21
Cedric Moonen13-Nov-07 22:21 
AnswerRe: Problem with CPU Usage Pin
Peter Weyzen13-Nov-07 21:59
Peter Weyzen13-Nov-07 21:59 
QuestionMemory usage Pin
g_sandipan13-Nov-07 20:50
g_sandipan13-Nov-07 20:50 
AnswerRe: Memory usage Pin
only coder13-Nov-07 21:00
only coder13-Nov-07 21:00 
GeneralRe: Memory usage Pin
g_sandipan13-Nov-07 23:00
g_sandipan13-Nov-07 23:00 
AnswerRe: Memory usage Pin
Roger Stoltz14-Nov-07 0:47
Roger Stoltz14-Nov-07 0:47 
QuestionNeed help with array in C [modified] Pin
ndtoan1313-Nov-07 20:49
ndtoan1313-Nov-07 20:49 
I always get y_num=0 when y_num=65536

How to get rid of this problem (variable type,...)
Please help.

#include<br />
#include<br />
#include<br />
#include<br />
#include<br />
<br />
typedef unsigned int WORD;<br />
typedef WORD* WORDPTR;<br />
<br />
WORDPTR *S;<br />
WORDPTR D;<br />
<br />
WORD x_num;<br />
WORD y_num;<br />
<br />
WORD a;<br />
WORD b;<br />
WORD i, j;<br />
int main()<br />
{<br />
puts("------------------ Start --------------------");<br />
puts("");<br />
<br />
a = 0;<br />
printf("Enter a = ");<br />
scanf("%u", &a);<br />
<br />
<br />
b = 0;<br />
printf("Enter b = ");<br />
scanf("%u", &b);<br />
<br />
x_num = 1 << a;<br />
y_num = 1 << b;<br />
<br />
S = (WORDPTR *)malloc(x_num*sizeof(WORDPTR));<br />
if (S == NULL)<br />
{<br />
puts("Error 1!");<br />
return 1;<br />
}<br />
for (i = 0; i < x_num; i++)<br />
{<br />
S[i] = (WORDPTR)malloc(y_num*sizeof(WORD));<br />
if (S[i] == NULL)<br />
{<br />
puts("Error 2!");<br />
return 1;<br />
}<br />
}<br />
<br />
D = (WORDPTR)malloc(y_num*sizeof(WORD));<br />
if (D == NULL)<br />
{<br />
puts("Error 3!");<br />
return 1;<br />
}<br />
puts("OK!");<br />
<br />
return (0);<br />
} 



-- modified at 4:15 Wednesday 14th November, 2007


AnswerRe: Need help with array in C Pin
Leslie Sanford13-Nov-07 21:26
Leslie Sanford13-Nov-07 21:26 
AnswerRe: Need help with array in C Pin
CPallini13-Nov-07 21:38
mveCPallini13-Nov-07 21:38 
GeneralRe: Need help with array in C Pin
ndtoan1313-Nov-07 21:50
ndtoan1313-Nov-07 21:50 
GeneralRe: Need help with array in C Pin
ndtoan1313-Nov-07 22:11
ndtoan1313-Nov-07 22:11 
GeneralRe: Need help with array in C Pin
CPallini13-Nov-07 22:32
mveCPallini13-Nov-07 22:32 
GeneralRe: Need help with array in C Pin
ndtoan1313-Nov-07 22:54
ndtoan1313-Nov-07 22:54 
GeneralRe: Need help with array in C Pin
CPallini13-Nov-07 23:01
mveCPallini13-Nov-07 23:01 
GeneralRe: Need help with array in C Pin
ndtoan1313-Nov-07 23:21
ndtoan1313-Nov-07 23:21 
QuestionHow evoke a modal dialog box in a CWinTread Class Pin
vethathiri13-Nov-07 20:23
vethathiri13-Nov-07 20:23 
AnswerRe: How evoke a modal dialog box in a CWinTread Class Pin
Peter Weyzen13-Nov-07 22:05
Peter Weyzen13-Nov-07 22:05 
AnswerRe: How evoke a modal dialog box in a CWinTread Class Pin
ThatsAlok13-Nov-07 23:30
ThatsAlok13-Nov-07 23:30 
GeneralRe: How evoke a modal dialog box in a CWinTread Class Pin
vethathiri15-Nov-07 0:05
vethathiri15-Nov-07 0:05 
GeneralRe: How evoke a modal dialog box in a CWinTread Class Pin
vethathiri15-Nov-07 0:05
vethathiri15-Nov-07 0:05 
AnswerRe: How evoke a modal dialog box in a CWinTread Class Pin
Mark Salsbery14-Nov-07 7:47
Mark Salsbery14-Nov-07 7:47 
AnswerRe: How evoke a modal dialog box in a CWinTread Class Pin
Blake Miller16-Nov-07 4:46
Blake Miller16-Nov-07 4:46 
QuestionHow evoke a moda dialog box in a CWinTread Class Pin
vethathiri13-Nov-07 20:23
vethathiri13-Nov-07 20:23 
Questioncheckbox caption Pin
subramanyeswari13-Nov-07 20:14
subramanyeswari13-Nov-07 20:14 

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.