Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can create heading and format cell text in excel? Pin
Richard MacCutchan10-Mar-11 23:56
mveRichard MacCutchan10-Mar-11 23:56 
AnswerRe: How can create heading and format cell text in excel? Pin
Cool_Dev11-Mar-11 0:10
Cool_Dev11-Mar-11 0:10 
QuestionCopying From Single Dimension Array To Multiple Dimension Array Pin
Mike Certini10-Mar-11 15:06
Mike Certini10-Mar-11 15:06 
AnswerRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
chevu10-Mar-11 17:30
chevu10-Mar-11 17:30 
GeneralRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
Mike Certini10-Mar-11 17:51
Mike Certini10-Mar-11 17:51 
AnswerRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
chevu10-Mar-11 18:11
chevu10-Mar-11 18:11 
AnswerRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
Richard MacCutchan10-Mar-11 22:38
mveRichard MacCutchan10-Mar-11 22:38 
AnswerRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
Stefan_Lang11-Mar-11 2:18
Stefan_Lang11-Mar-11 2:18 
For one, transarr() does not get all the information it needs: You have a single, one-dimensional array with 5 elements, and try to transfer it into another array with ROWS rows. But you do not give an indication about the width of those rows in the parameters. The width is only given through the global symbol SIZE2. Pass SIZE2 as a parameter instead, so transarr() does not depend on a global value and can be reused for different cases.

Second, in your main program you define a two-dimensional array arr2, but you do not use it. Instead you pass another variable, arr3 to transarr - that doesn't make sense. I think your intention was to copy the members of arr into arr2, no? If so, you do not need the variable arr3, you can pass arr2 into the call of transarr(), you don't even need to change the function declaration for that.

Third, the purpose of transarr is somewhat ... unusual: In your code you copy the original array into each row, creating multiple copies of that array. Is that your intention? Also, if SIZE2 happens to be greater than SIZE, then your copy loop will run into undefined memory as it will read beyond arr. Of course at the moment nothing happens, but if you get your program to run and later change SIZE or SIZE2, you might end up with random values in your resulting array and not know where they originate from.
QuestionRe: Copying From Single Dimension Array To Multiple Dimension Array Pin
David Crow11-Mar-11 2:49
David Crow11-Mar-11 2:49 
QuestionData Structure library Pin
pandit8410-Mar-11 2:32
pandit8410-Mar-11 2:32 
AnswerRe: Data Structure library Pin
Richard MacCutchan10-Mar-11 3:30
mveRichard MacCutchan10-Mar-11 3:30 
GeneralRe: Data Structure library Pin
pandit8410-Mar-11 23:39
pandit8410-Mar-11 23:39 
GeneralRe: Data Structure library Pin
Richard MacCutchan10-Mar-11 23:52
mveRichard MacCutchan10-Mar-11 23:52 
QuestionProblems with MFCTabCtrl/MDITabbedControl Pin
Dansveen10-Mar-11 2:27
Dansveen10-Mar-11 2:27 
QuestionHandle leaks in WinSock - WIndows Application (MFC) Pin
chevu10-Mar-11 1:09
chevu10-Mar-11 1:09 
AnswerRe: Handle leaks in WinSock - WIndows Application (MFC) Pin
Niklas L10-Mar-11 20:58
Niklas L10-Mar-11 20:58 
GeneralRe: Handle leaks in WinSock - WIndows Application (MFC) Pin
chevu10-Mar-11 21:33
chevu10-Mar-11 21:33 
AnswerRe: Handle leaks in WinSock - WIndows Application (MFC) Pin
bob1697211-Mar-11 1:54
bob1697211-Mar-11 1:54 
GeneralRe: Handle leaks in WinSock - WIndows Application (MFC) Pin
chevu11-Mar-11 2:34
chevu11-Mar-11 2:34 
GeneralRe: Handle leaks in WinSock - WIndows Application (MFC) Pin
bob1697211-Mar-11 3:10
bob1697211-Mar-11 3:10 
Questionhow to fastforward in directshow Pin
raj157610-Mar-11 1:01
raj157610-Mar-11 1:01 
AnswerRe: how to fastforward in directshow Pin
Richard MacCutchan10-Mar-11 3:28
mveRichard MacCutchan10-Mar-11 3:28 
AnswerRe: how to fastforward in directshow Pin
Cool_Dev10-Mar-11 5:19
Cool_Dev10-Mar-11 5:19 
QuestionProblem with RegisterPowerSettingNotification and USER32.dll. Pin
aangerma10-Mar-11 0:31
aangerma10-Mar-11 0:31 
AnswerRe: Problem with RegisterPowerSettingNotification and USER32.dll. Pin
Hans Dietrich10-Mar-11 0:35
mentorHans Dietrich10-Mar-11 0:35 

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.