Scanf function changes value of in-loop variable

Ali Çehreli acehreli at yahoo.com
Wed Apr 16 11:06:43 PDT 2014


On 04/16/2014 10:47 AM, Capture_A_Lag wrote:

 > ubyte tmp;

 >          scanf("%d", &tmp);
 >                  // After this scanf n becomes 0 for no reason

%d is for int.

Ali

P.S. A friendly request: It makes it much easier for the rest of the 
group if posts contained compilable, minimal but complete code. Thanks.



More information about the Digitalmars-d-learn mailing list