hello .
is there any function that returns the system time ?
for example when it is 8:30 , it returns 8-30.
if yes can I use the value that the function has returned (in the above example 8 & 30) in another proces as
int numbers ?
thanks .
hello .
is there any function that returns the system time ?
for example when it is 8:30 , it returns 8-30.
if yes can I use the value that the function has returned (in the above example 8 & 30) in another proces as
int numbers ?
thanks .
take a look at the standard c header time.h it should have all you need. It is impossible to directly get a time number as an int, it cant hold the numbers. You have to convert it into an int.
>for example when it is 8:30 , it returns 8-30
Is this just an example, or is it what you need? The <ctime> functions return a value that fits within the type time_t, and carries considerably more information than just the hour and minute. You can use other <ctime> functions and types to get what you want out of it though.
My best code is written with the delete key.
See the FAQ and cppreference.com.
[EDIT] - And, get a book! The basics of <ctime> should be covered any beginning C++ book.
BTW - In order to completely understand the <ctime> functions, you have to understand pointers and structures which should also be covered in any beginning C++ book.
Last edited by DougDbug; 12-10-2003 at 01:39 PM.