LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 02-10-2008, 08:28 PM   #1
nasim751
Member
 
Registered: Jan 2008
Posts: 40

Rep: Reputation: 15
Smile warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast


hello,
how you will deal this problem............

warning: passing argument 2 of ‘strcpy’ makes pointer from integer without a cast


Code:
t = time((time_t *) 0);
    strcpy(buf, ctime(&t));
regards
 
Old 02-10-2008, 09:44 PM   #2
cetialphav
Member
 
Registered: Sep 2003
Location: Raleigh, NC, USA
Distribution: Fedora
Posts: 88

Rep: Reputation: 16
It looks like something is wrong here. I think the ctime you are calling is not the one you think you are calling. That code works for me. ctime should be returning a char * so you shouldn't see the error you are seeing. The ctime you are calling appears to return an int. So the question is where is that ctime coming from. Have you included time.h?
 
Old 02-10-2008, 10:47 PM   #3
nasim751
Member
 
Registered: Jan 2008
Posts: 40

Original Poster
Rep: Reputation: 15
hello,
Thanks for idea. yes i over come that error. i included time.h. now its ok.
regards
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: passing argument 2 of ‘memset’ makes integer from pointer without a cast nasim751 Programming 3 01-30-2008 09:16 AM
cast from pointer to integer of different size: what is the problem??? bobo333 Linux - Software 2 08-27-2006 09:59 PM
makes pointer from integer without a cast ? hubabuba Programming 2 01-28-2005 05:28 PM
pointer from integer without a cast bcf2 Programming 7 12-30-2004 02:04 PM
Passing arg 3 of blah makes pointer from integer without a cast xconspirisist Programming 6 08-22-2004 08:04 AM


All times are GMT -5. The time now is 09:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration