Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionOne-time initialization of an ActiveX control in CFormView-derived class Pin
sashoalm14-May-10 5:48
sashoalm14-May-10 5:48 
AnswerRe: One-time initialization of an ActiveX control in CFormView-derived class Pin
«_Superman_»14-May-10 6:35
professional«_Superman_»14-May-10 6:35 
QuestionHow to return 2-dimension array in a function Pin
akira3214-May-10 5:48
akira3214-May-10 5:48 
AnswerRe: How to return 2-dimension array in a function Pin
CPallini14-May-10 6:30
mveCPallini14-May-10 6:30 
AnswerRe: How to return 2-dimension array in a function [modified] Pin
Aescleal14-May-10 11:48
Aescleal14-May-10 11:48 
AnswerRe: How to return 2-dimension array in a function Pin
Richard MacCutchan14-May-10 21:32
mveRichard MacCutchan14-May-10 21:32 
GeneralRe: How to return 2-dimension array in a function Pin
Aescleal15-May-10 7:22
Aescleal15-May-10 7:22 
AnswerRe: How to return 2-dimension array in a function Pin
sashoalm15-May-10 2:25
sashoalm15-May-10 2:25 
You shouldn't be returning an array, the best thing is to accept a pointer to an array allocated by the caller (plus dimensions) and then fill it. That way you'll avoid the problem of who has to do the cleanup of the memory. For example this function will fill the array with random values:


int foo (int* dstArr, int m, int n)
{
  for (int i=0;i<m;i++)
    for (int j=0;j<n;j++)
      dstArr[i*n+j] = rand();
}
int main()
{
  int arr[3][5], arr2[10][10];
  foo((int*)arr, 3, 5);
  foo((int*)arr2, 10, 10);
}

There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal

GeneralRe: How to return 2-dimension array in a function Pin
akira3218-May-10 6:06
akira3218-May-10 6:06 
QuestionVirtual keyboard API or code that runs on WinXP and/or Vista? Pin
KellyR14-May-10 3:49
KellyR14-May-10 3:49 
QuestionProblem with writeprivateprofilestring() Pin
Shivanand Gupta14-May-10 3:29
Shivanand Gupta14-May-10 3:29 
QuestionRe: Problem with writeprivateprofilestring() Pin
David Crow14-May-10 7:58
David Crow14-May-10 7:58 
AnswerRe: Problem with writeprivateprofilestring() Pin
Shivanand Gupta14-May-10 20:31
Shivanand Gupta14-May-10 20:31 
QuestionRAPI funcion generate problem in CFileDialog handling. Pin
Le@rner14-May-10 2:32
Le@rner14-May-10 2:32 
AnswerRe: RAPI funcion generate problem in CFileDialog handling. Pin
Cedric Moonen14-May-10 4:13
Cedric Moonen14-May-10 4:13 
GeneralRe: RAPI funcion generate problem in CFileDialog handling. Pin
Le@rner14-May-10 18:19
Le@rner14-May-10 18:19 
QuestionConverting something in MFC (.NET) to work under wxWidgets (for windows only) Pin
brdavid14-May-10 2:17
brdavid14-May-10 2:17 
AnswerRe: Converting something in MFC (.NET) to work under wxWidgets (for windows only) Pin
Tim Craig14-May-10 14:38
Tim Craig14-May-10 14:38 
Questionmaze in c Pin
hasani200714-May-10 2:00
hasani200714-May-10 2:00 
AnswerRe: maze in c Pin
CPallini14-May-10 2:05
mveCPallini14-May-10 2:05 
GeneralRe: maze in c Pin
Luc Pattyn14-May-10 8:08
sitebuilderLuc Pattyn14-May-10 8:08 
GeneralRe: maze in c Pin
CPallini14-May-10 10:19
mveCPallini14-May-10 10:19 
AnswerRe: maze in c Pin
Maximilien14-May-10 2:29
Maximilien14-May-10 2:29 
AnswerRe: maze in c Pin
Iain Clarke, Warrior Programmer14-May-10 4:50
Iain Clarke, Warrior Programmer14-May-10 4:50 
QuestionRe: maze in c Pin
David Crow14-May-10 8:00
David Crow14-May-10 8:00 

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.