I am having second thoughts about the book I am studying.. on more than one occasion, I have ended up debugging the author's examples... (Windows Programming with C++ -Henning Hansen) Here is my latest example:
Code:
LRESULT CALLBACK WndProc(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam)
{
static BYTE Pixel[6][5] = {0, 255, 0, 255, 0, 0,
255, 0, 255, 0 255, 0,
0, 255, 0, 255, 0, 0,
255, 0, 255, 0, 255,0,
0, 255, 0, 255, 0, 0};
static HBITMAP hBitmap;
static HDC hdcmem;
switch(msg)
{
case WM_LBUTTONDOWN:
The program compiles except for one error.. stating that Pixel data structure was terminated incorrectly..
This method for initializing a 2D array looks kinda shady to me..
Q: is there a better/preferred method for initializing a 2D array like the one above..??
thanks in advance