I am trying to make a program that reads the seconds from the system time and prints them on the screen. However, the seconds always seem to be in integer format and I wish to use it in floating point format instead, i.e. to display milliseconds. Is this possible?
Here is the current program I am using. It's similar to the one found on the time_t page at Wikipedia.
Code:#include <stdio.h> #include <time.h> main() { time_t now; struct tm ts; char buf[80]; time(&now); ts = *localtime(&now); strftime(buf, sizeof(buf), "%S", &ts); printf("%s\n", buf); }



LinkBack URL
About LinkBacks


