LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2006, 01:34 AM   #1
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Rep: Reputation: 15
typecast


i want to typecast one variable having datatype time_t into char * .....how to do it??
plz send me detail info..

thanks in advance
 
Old 02-01-2006, 01:55 AM   #2
sojason
LQ Newbie
 
Registered: Sep 2005
Location: Göteborg, Sweden
Distribution: Debian - Sarge
Posts: 3

Rep: Reputation: 0
Do you want to typecast it to a char pointer or do you want to convert a time to a character string?

What language are you using? C? C++?
 
Old 02-01-2006, 04:26 AM   #3
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Original Poster
Rep: Reputation: 15
Question

i am using c language. and i want to typecast it char *.
actually i want to copy the time into char * variable.
 
Old 02-01-2006, 05:06 AM   #4
mic
Member
 
Registered: Jun 2005
Posts: 44

Rep: Reputation: 16
This is not called typecasting. You want to convert a number to string. Use snprintf or sprintf function for this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
g++ typecast complaining too much! The_Nerd Programming 12 05-11-2004 06:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration