Hello there,
I was trying to build a standard calculator version. The standard calculator is just like the calculator that comes with MS Windows.
As you can observe, there are 17 buttons. I am too lazy to copy and paste the function CreateWindow() 17 times ( note: there are 4 differences for each - namely the x and y coordinates, the name (LPCSTR) and the hMenu parameters - ). So I have written a general formula for them and put it in loops:
but nothing happened!!!Code:char numbers[10] = "741852963"; int i = 0, j = 1, counter = 0; while(i<3) { while(j<4) { window = CreateWindow("button", (LPCSTR)numbers[counter], WS_VISIBLE|WS_CHILD, 35*i+5, 35*j+10, 30, 30, wnd, (HMENU)(UINT_PTR)counter, NULL, NULL); j += 1; counter += 1; } i += 1; j = 1; }