While i am working ,somewhere inside the code i saw the following staements.
I am getting confused by the format specifier in sprintf
d_number = strtol( tmp_buf , (char **)NULL, 16);
memset( tmp_buf , ' ' , sizeof( tmp_buf ) );
sprintf( tmp_buf , "%0.*d" , (int)sizeof( dec_number ) , d_number );
could anybody explain please?
.*means the precision is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted. (d_number)http://www.cplusplus.com/reference/clibrary/cstdio/printf/