Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c++ , unix,system functions 1

Status
Not open for further replies.

tanushri

Programmer
Oct 1, 2001
2
US
HI friends

Iam just a begginer of using c++ on linux.So want
to know what is the function to get the system time and date and to clear the screen.
Please can u specify the header files also.
Iam also finding difficulty in declaring string variables
using string class (i have also specified the header file
string.h)..it shows an error that string not defined.

Thanking u
tanushri
 
hi tanushri,
well since you are using linux, hence the header file
<string.h> will not work. Instead you should use the
<cstring> header file.
In Linux, if you want to view the system date and time, you can do it using the &quot;date&quot; function. It will show you the date and time, also if you want to format it, do as follows:
'$' or '#' //this is your command prompt
#date &quot;Todays date is +%d&quot;
%d is for date, %m is for month and %y is for year.
 
HI parul
Thanx for ur kind suggestion.
it worked.

thanx.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top