Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
これは単純な問題ですが、私には見えません:
char *s = "f 8.649292" ; ダブル d ; sscanf( s, "f %f", &d ) ; printf( "d は %f\n", d ) ;
ddouble 値が含まれていないのはなぜ8.649292ですか?
d
8.649292
待って、気にしないで。d は a である必要がありますfloat。
float
%lfそして、それを機能させるために、ダブルに使用できます
%lf
char *s = "f 8.649292" ; ダブル d ; sscanf( s, "f %lf", &d ) ; printf( "d は %lf\n", d ) ;