Click here to Skip to main content
15,889,909 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to pass two dimensional arrays in a function (c++) Pin
mrby12330-Apr-10 9:04
mrby12330-Apr-10 9:04 
AnswerRe: how to pass two dimensional arrays in a function (c++) Pin
«_Superman_»30-Apr-10 9:05
professional«_Superman_»30-Apr-10 9:05 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
mrby12330-Apr-10 9:38
mrby12330-Apr-10 9:38 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
David Crow30-Apr-10 10:40
David Crow30-Apr-10 10:40 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
mrby12330-Apr-10 10:45
mrby12330-Apr-10 10:45 
QuestionRe: how to pass two dimensional arrays in a function (c++) Pin
David Crow30-Apr-10 11:10
David Crow30-Apr-10 11:10 
AnswerRe: how to pass two dimensional arrays in a function (c++) Pin
mrby12330-Apr-10 11:18
mrby12330-Apr-10 11:18 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
CPallini30-Apr-10 11:10
mveCPallini30-Apr-10 11:10 
If the array bounds are fixed then you may safely use them, for instance:
int fun(int a[3][5])
{
//...
}


in the other hand, if the array bounds may vary then you need to pass them to the function, fo instance (this may depend on how do you allocated the array)
int fun(int * a, int m, int n)
{
//...
}

Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

GeneralRe: You are right, set array bounds. Pin
Software_Developer1-May-10 0:58
Software_Developer1-May-10 0:58 
GeneralRe: how to pass two dimensional arrays in a function (c++), please check Pin
mrby1233-May-10 12:27
mrby1233-May-10 12:27 
GeneralRe: how to pass two dimensional arrays in a function (c++), please check Pin
CPallini3-May-10 21:15
mveCPallini3-May-10 21:15 
GeneralRe: how to pass two dimensional arrays in a function (c++), please check Pin
mrby1234-May-10 5:56
mrby1234-May-10 5:56 
GeneralRe: how to pass two dimensional arrays in a function (c++), please check Pin
CPallini4-May-10 6:04
mveCPallini4-May-10 6:04 
GeneralRe: how to pass two dimensional arrays in a function (c++), please check Pin
mrby1234-May-10 6:22
mrby1234-May-10 6:22 
AnswerRe: how to pass two dimensional arrays in a function (c++) Pin
Software_Developer1-May-10 0:42
Software_Developer1-May-10 0:42 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
mrby1231-May-10 18:56
mrby1231-May-10 18:56 
GeneralRe: how to pass two dimensional arrays in a function (c++) Pin
mrby1233-May-10 10:23
mrby1233-May-10 10:23 
QuestionHow to get application focus? Pin
Software200730-Apr-10 5:04
Software200730-Apr-10 5:04 
AnswerRe: How to get application focus? Pin
Randor 30-Apr-10 5:25
professional Randor 30-Apr-10 5:25 
QuestionRe: How to get application focus? Pin
David Crow30-Apr-10 9:06
David Crow30-Apr-10 9:06 
AnswerRe: How to get application focus? Pin
Patcher3230-Apr-10 11:52
Patcher3230-Apr-10 11:52 
QuestionWindows Installers Pin
Leif Goodwin30-Apr-10 3:07
Leif Goodwin30-Apr-10 3:07 
AnswerRe: Windows Installers Pin
Cedric Moonen30-Apr-10 3:18
Cedric Moonen30-Apr-10 3:18 
AnswerRe: Windows Installers Pin
KingsGambit30-Apr-10 4:30
KingsGambit30-Apr-10 4:30 
AnswerRe: Windows Installers Pin
rahul.kulshreshtha30-Apr-10 23:51
rahul.kulshreshtha30-Apr-10 23:51 

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.