--- In [email protected], "Faisal Shahzad" <[EMAIL PROTECTED]> wrote: > > i want to make a calculator in c++ MFC but i want hint plz give me hint > how i made logic that when user press for example 1 display in edit box > 1 after that when i press 2 then written 2 on right side mean it beome > 12. i m waiting for ur help plz reply soon >
for this take an integer as val val = 0 every time you input a number say x val = ( val * 10 ) + x; for example first time you enter 1 so val = 0 val = ( val * 10 ) + 1; therefore val = 1 second time you enter 2 currently val = 1 val = ( val * 10 ) + 2 ==> val = 1 * 10 + 2 therefore val = 12 and so on.
