הצגת השעה

ShikiBrun

New member
הצגת השעה

איך מציגים את השעה על המסך בC++? אני משתמש בTURBO... משהו כזה: 00:00:00, תודה.
 

משועמם14

New member
תנסה:

copy paste from MSDN:
* CTIME.C: This program gets the current * time in time_t form, then uses ctime to * display the time in string form. */ #include <time.h> #include <stdio.h> void main( void ) { time_t ltime; time( &ltime ); printf( "The time is %s\n", ctime( &ltime ) ); } Output The time is Fri Apr 29 12:25:12 1994​
 

משועמם14

New member
סליחה, הקוד לא יצא טוב ב PASTE

#include <time.h> #include <stdio.h> void main( void ) { time_t ltime; time( &&ltime ); printf( "The time is %s\n", ctime( &&ltime ) ); } in case its no good again - you send the POINTER of ltime to the functions .....​
 
למעלה