Click here to Skip to main content
15,891,431 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reserve string in c Pin
Richard MacCutchan16-Nov-14 23:44
mveRichard MacCutchan16-Nov-14 23:44 
Questionplz solution this programe???????????? Pin
Member 1123778816-Nov-14 3:08
Member 1123778816-Nov-14 3:08 
GeneralRe: plz solution this programe???????????? PinPopular
Richard MacCutchan16-Nov-14 3:43
mveRichard MacCutchan16-Nov-14 3:43 
GeneralRe: plz solution this programe???????????? Pin
David Crow17-Nov-14 5:58
David Crow17-Nov-14 5:58 
GeneralRe: plz solution this programe???????????? Pin
Richard MacCutchan17-Nov-14 6:11
mveRichard MacCutchan17-Nov-14 6:11 
AnswerRe: plz solution this programe???????????? Pin
Chris Losinger17-Nov-14 4:55
professionalChris Losinger17-Nov-14 4:55 
QuestionMenu change in IDE but not in running application Pin
Gagnon Claude14-Nov-14 10:50
Gagnon Claude14-Nov-14 10:50 
AnswerRe: Menu change in IDE but not in running application Pin
Richard Andrew x6414-Nov-14 12:51
professionalRichard Andrew x6414-Nov-14 12:51 
QuestionRe: Menu change in IDE but not in running application Pin
Richard MacCutchan14-Nov-14 21:29
mveRichard MacCutchan14-Nov-14 21:29 
QuestionHow to change the name of a tabbed pane Pin
Gagnon Claude12-Nov-14 9:10
Gagnon Claude12-Nov-14 9:10 
AnswerRe: How to change the name of a tabbed pane Pin
Richard MacCutchan12-Nov-14 21:18
mveRichard MacCutchan12-Nov-14 21:18 
Questionc++ help Pin
Member 1122785412-Nov-14 3:44
Member 1122785412-Nov-14 3:44 
AnswerRe: c++ help Pin
Richard MacCutchan12-Nov-14 4:21
mveRichard MacCutchan12-Nov-14 4:21 
GeneralRe: c++ help Pin
Member 1122785414-Nov-14 4:09
Member 1122785414-Nov-14 4:09 
GeneralRe: c++ help Pin
Richard MacCutchan14-Nov-14 6:10
mveRichard MacCutchan14-Nov-14 6:10 
AnswerRe: c++ help Pin
CPallini13-Nov-14 21:35
mveCPallini13-Nov-14 21:35 
GeneralRe: c++ help Pin
Member 1122785414-Nov-14 4:12
Member 1122785414-Nov-14 4:12 
GeneralRe: c++ help Pin
Albert Holguin14-Nov-14 4:14
professionalAlbert Holguin14-Nov-14 4:14 
GeneralRe: c++ help Pin
Member 1122785414-Nov-14 4:29
Member 1122785414-Nov-14 4:29 
GeneralRe: c++ help Pin
Maximilien14-Nov-14 4:58
Maximilien14-Nov-14 4:58 
SuggestionRe: c++ help Pin
David Crow14-Nov-14 16:24
David Crow14-Nov-14 16:24 
GeneralTwo dimmensional array using pointers on Arduino Due Pin
Vaclav_10-Nov-14 9:43
Vaclav_10-Nov-14 9:43 
<pre lang="text">
I am trying to build a two dimmensional array - accessing LCD of 10 rows and 20 columns and be able to pass the pointer(s) to a function.
The function / method is declared in class and so is the pointer:

boolean DisplayImage(int **Display);
int **Display;

</pre>

And the function:
<pre lang="c++">

boolean CImage::DisplayImage(int **Display)
{

#ifdef DEBUG
TRACE("CImage::DisplayImage ** ", 1);
#endif

int i, j, iRow, iCol;
iRow = 10;
iCol = 20;
int iCount = 0;

for ( i = 0; i < iRow; i++) {
for (j = 0; j < iCol; j++) {
lcd_i2c.clear();
lcd_i2c.print("location ");
lcd_i2c.setCursor(0, 1);
lcd_i2c.print("row i ");
lcd_i2c.print(i );
lcd_i2c.print(" col j ");
lcd_i2c.print(j );
lcd_i2c.setCursor(0, 2);
lcd_i2c.print("Display ");
**Display = iCount++; // set test value - works
lcd_i2c.print(**Display); // display is OK
// lcd_i2c.setCursor(0, 3);
// lcd_i2c.print("mask center ");
// lcd_i2c.print(**image );
**Display++;
delay(500);
}
}

return true;
}

</pre>

Here is how I initialize the array

<pre lang="c++">
CImage::CImage (void)
{
// initialize array using pointers
// int **Display;
Display = new int *[10]; // display rows
for (int i = 0; i < 20; i++)
Display[i] = new int[10]; // display columns

}
</pre>

Here are my questions:
1. I need some explanation about this syntax "Display = new int *[10]" - is the "Display " the variable name ?
2. I may have the rows / columns reversed because<b> I really do not understand how is the array initialized</b>.( <b><b></b>That is my main question</b> - I can take it from there ).
3. Unfortunatelly the example I got this from had 10 by 10 array so I am lost as far as what are the columns and what are the rows.
4. I use rows and columns because that is the underlying hardware and I understand it is irrelevant as far as multidimmensioal array goes.
5. Under present initialization I cannot get the LCD print pass first "row". The processor just stops ( Arduino Due). I would expect it to keep printing even if I runs out of valid pointer, but that is not the case. I sure would like to know why. ( It "runs" GCC compiler).
Thank you for your time and help. Appreciate it.
Cheers Vaclav

PS I do not have a real debugger and using the LCD as "trace / debug "
GeneralRe: Two dimmensional array using pointers on Arduino Due Pin
Albert Holguin10-Nov-14 16:58
professionalAlbert Holguin10-Nov-14 16:58 
GeneralRe: Two dimmensional array using pointers on Arduino Due Pin
Vaclav_11-Nov-14 3:39
Vaclav_11-Nov-14 3:39 
SuggestionMessage Closed Pin
15-Nov-14 7:37
4india15-Nov-14 7:37 

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.