I think you can use the c++ getch() with accepts a character without displaying it.
Type: Posts; User: greenberet
I think you can use the c++ getch() with accepts a character without displaying it.
thanks Salem now i got a clearer picture of scanf.
char c;
while(scanf("%c\n",&c)==1 && c=='y')
printf("Hello");
//or
char c;
while(scanf("%c\n",&c), c=='y')
printf("Hello");
well you're defining the formal argument to the det function (i.e n) with the same name as the constant
you defined.
i.e #define n
all right here is the modified code but it still produces strange results. It doesn't work the first time you press y\n but the second time onwards it works
char c;...
the above code just goes through the loop once and does not ask for any more input.
now if i replace %c with %d and make that variable an int and do c==1 then the program works as desired.
hey I've just been using the comma operator and it is not producing the expected results
char c;
while(scanf("%c",&c),c=='y')
{
printf("Yes");
}
thanks for the replies. It's been real useful to know that float numbers are approximations and may give absurd results.
I had just been going through complex XORing to swap 2 variables without...
hey i am a complete newbie to c.
I am having this problem with floating points and the output is producing really wired results
I'm using gcc to compile it
float i=0.0;...