I found interesting format for printing nonterminated fixed length strings like this:
char newstr[40] = {0};
sprintf(newstr,"%.*s", sizeof(mystr), mystr);
So I think maybe is there a way under printf command for printing a float number...
"%8.2f"
to have ability to choose number of decimals with integer number.
Something like this:
sprintf(mystr, "%d %f", numberofdecimals, floatnumbervalue)
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…