| | |
bitmap display
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 9
Reputation:
Solved Threads: 0
i have this constructor to display a bitmap and it displays with 1's and 0's..i jus need 2 know how 2 make the 0's into *'s...i think its an if statement but i dont know exactly were
void bitmap::display() const
{
for (int r = 0; r < numrows; r++)
{
for (int c = 0; c < numcols; c++)
cout << grid[r][c] << ' ';
cout << endl;
}
}
void bitmap::display() const
{
for (int r = 0; r < numrows; r++)
{
for (int c = 0; c < numcols; c++)
cout << grid[r][c] << ' ';
cout << endl;
}
}
•
•
Join Date: Apr 2008
Posts: 129
Reputation:
Solved Threads: 22
cpp Syntax (Toggle Plain Text)
cout << grid[r][c]?'1':'*' << ' ';
•
•
Join Date: Aug 2007
Posts: 129
Reputation:
Solved Threads: 15
is grid an array chars?
or
c++ Syntax (Toggle Plain Text)
cout << (grid[r][c] == '1') ? '1' : '*' << ' ';
c++ Syntax (Toggle Plain Text)
if(grid[r][c] == '0') cout << '*'; else cout << '1';
![]() |
Similar Threads
- Moving a captured bitmap picture across a LAN nework (VB.NET)
- Help with outputting bitmap data in a display window (Python)
- Displaying bitmap (C++)
- Coding standard? (C++)
- Drawing bitmap on window - how to clear window/HDC? (C)
- Bitmap display probelm. (C)
- Using an Array to declare multiple bitmap handlers (C)
- Displaying a different bitmap in different child windows? - win32 in C (C)
Other Threads in the C++ Forum
- Previous Thread: Array Length help
- Next Thread: Program encouters a problem a needs to close everytime i run my program
| Thread Tools | Search this Thread |
api application array arrays based binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg simple sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





