ok hopefully ive got these code tags right you lot seem fussy about them Im very new to c infact only been looking at it the last few days Im used to delphi. can anyone tell me why the following program
a) only runs through the for loop once
b) how to clear the buffer from the last choice made. e.g te first time I ran this program I entered 10 and now no matter what I enter it remembers that 10.
thanks in advance
Code:#include <stdio.h> int main () { int itst = 1; int cnt; for (cnt=0;cnt<5;cnt++); { printf ("Enter No. For Variable : "); while ((itst = getchar()) != '\n' && itst != EOF); printf ("%d is at %p : ",itst,&itst); } }