Thread: a question about a time.h function

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    72

    a question about a time.h function

    hi,
    could you provide me by an example about how can i use this function
    char* ctime(const time_t* timer)
    thanks a lot
    proud to be from aui www.aui.ma and also a great elton john's fan

  2. #2

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    is there any other method where i can only take the time stored in the computer calendar and use it in my program?
    proud to be from aui www.aui.ma and also a great elton john's fan

  4. #4

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    >could you provide me by an example about how can i use this function
    Code:
    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>
    
    int main(void)
    {
        time_t cur_time;
       
        cur_time = time(NULL);
        printf("%s", ctime(&cur_time));
    
        return 0;
    }

  6. #6
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    thanks a lot
    proud to be from aui www.aui.ma and also a great elton john's fan

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Calling a Thread with a Function Pointer.
    By ScrollMaster in forum Windows Programming
    Replies: 6
    Last Post: 06-10-2006, 08:56 AM
  3. Change this program so it uses function??
    By stormfront in forum C Programming
    Replies: 8
    Last Post: 11-01-2005, 08:55 AM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM