Scanf function changes value of in-loop variable

Justin Whear justin at economicmodeling.com
Wed Apr 16 11:22:49 PDT 2014


On Wed, 16 Apr 2014 18:17:37 +0000, Capture_A_Lag wrote:

> Thank you everybody!!!
> I thought %d is ok for all integral types.

This is true when using the D format functions (e.g. readf) which are 
able to inspect the types of the variables being assigned, but scanf is a 
C function and not typesafe.

Justin


More information about the Digitalmars-d-learn mailing list