Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: count() function using STL Pin
BlackDice27-May-04 3:03
BlackDice27-May-04 3:03 
GeneralDirectShow and C++ (No-MFC) Pin
Paolo Ponzano26-May-04 10:33
Paolo Ponzano26-May-04 10:33 
GeneralRe: DirectShow and C++ (No-MFC) Pin
Antti Keskinen26-May-04 11:32
Antti Keskinen26-May-04 11:32 
GeneralRe: DirectShow and C++ (No-MFC) Pin
Paolo Ponzano26-May-04 19:23
Paolo Ponzano26-May-04 19:23 
GeneralTreeCtrl in DialogBar in MFC MDI Pin
NTense26-May-04 9:58
NTense26-May-04 9:58 
GeneralRe: TreeCtrl in DialogBar in MFC MDI Pin
valikac26-May-04 13:20
valikac26-May-04 13:20 
GeneralWord Automation help Pin
C++NewBe26-May-04 9:54
C++NewBe26-May-04 9:54 
GeneralGet around having to use constants for 2d dynamic memory allocation Pin
aero6dyn26-May-04 9:45
aero6dyn26-May-04 9:45 
I am writing dll programs to do some file conversions for scientific data. Is there any way for me to do a dyn. memory allocation with out having constants in between the brackets but rather have declared variables.
Here is what I have now..

const int X = 100;
const int Y = 50;
long (*data)[Y];
int x,y;
if (!(pix_data = new long[X][Y])) { printf("Error allocating memory...\n"); return 1; }

I cant figure out a way to have an integer in X and Y that is declared internally (in main()) rather than having 100 or 50. When I place integers, error comes up saying " expected constant expression". Thus, I need not specify 100 or 50 but it looks to other varibles to figure that out. I have looked everywhere..

Any help is appreciated.Cool | :cool: Cool | :cool:
GeneralRe: Get around having to use constants for 2d dynamic memory allocation Pin
Rob Manderson26-May-04 10:39
protectorRob Manderson26-May-04 10:39 
GeneralRe: Get around having to use constants for 2d dynamic memory allocation Pin
aero6dyn27-May-04 8:00
aero6dyn27-May-04 8:00 
GeneralBitmap trace Pin
Vaclav26-May-04 9:25
Vaclav26-May-04 9:25 
GeneralDesparate Help needed Pin
dhermann26-May-04 8:52
dhermann26-May-04 8:52 
GeneralRe: Desparate Help needed Pin
GermanGeorge28-May-04 4:14
GermanGeorge28-May-04 4:14 
Generalpointer arithemetic (on an STL iterator) Pin
BlackDice26-May-04 7:29
BlackDice26-May-04 7:29 
GeneralRe: pointer arithemetic (on an STL iterator) Pin
BlackDice26-May-04 7:40
BlackDice26-May-04 7:40 
Generalgot it! Pin
BlackDice26-May-04 8:12
BlackDice26-May-04 8:12 
GeneralRe: pointer arithemetic (on an STL iterator) Pin
David Crow26-May-04 8:16
David Crow26-May-04 8:16 
GeneralVARIANT Pin
Roger H Art26-May-04 6:59
sussRoger H Art26-May-04 6:59 
GeneralRe: VARIANT Pin
mezla26-May-04 21:42
mezla26-May-04 21:42 
GeneralVARIANT Pin
Anonymous26-May-04 6:58
Anonymous26-May-04 6:58 
GeneralWindows media player Pin
Trollslayer26-May-04 6:56
mentorTrollslayer26-May-04 6:56 
GeneralRe: Windows media player Pin
Michael Dunn26-May-04 8:32
sitebuilderMichael Dunn26-May-04 8:32 
GeneralRe: Windows media player Pin
Trollslayer26-May-04 9:45
mentorTrollslayer26-May-04 9:45 
GeneralDate/Time Picker in CListCtrl Pin
aswdwdwd26-May-04 6:40
aswdwdwd26-May-04 6:40 
GeneralCSerialPort Class Problem and Error 87 Pin
AnotherProgrammer26-May-04 6:25
AnotherProgrammer26-May-04 6: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.