Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Time function

Time function

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Supaflyfrank
    wrote on last edited by
    #1

    I am wondering how can I create a simple function that will return the current second,minutes and hour in a 3 dimensional int array. I been looking at the information on ctime in windows to see how I could do this but I havent found what I needed. I dont want the function to pause or anything I just want it to simply return the second, minutes and hours.

    J D 2 Replies Last reply
    0
    • S Supaflyfrank

      I am wondering how can I create a simple function that will return the current second,minutes and hour in a 3 dimensional int array. I been looking at the information on ctime in windows to see how I could do this but I havent found what I needed. I dont want the function to pause or anything I just want it to simply return the second, minutes and hours.

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      Check GetSystemTime or time_t time( time_t *timer ); Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • S Supaflyfrank

        I am wondering how can I create a simple function that will return the current second,minutes and hour in a 3 dimensional int array. I been looking at the information on ctime in windows to see how I could do this but I havent found what I needed. I dont want the function to pause or anything I just want it to simply return the second, minutes and hours.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Supaflyfrank wrote: ...return the current second,minutes and hour in a 3 dimensional int array. What is this? A 3D int array looks like:

        int arr[x][y][z];

        How do you propose to fill that up with "second, minutes and hour?"


        "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

        B 1 Reply Last reply
        0
        • D David Crow

          Supaflyfrank wrote: ...return the current second,minutes and hour in a 3 dimensional int array. What is this? A 3D int array looks like:

          int arr[x][y][z];

          How do you propose to fill that up with "second, minutes and hour?"


          "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

          B Offline
          B Offline
          Bob Stanneveld
          wrote on last edited by
          #4

          int arr[1][1][1]; perhaps... But I can't help to think that a better way to store time is in a structure like this: struct TIME { int m_nSeconds; int m_nMinutes; int m_nHours; }; There probably is a predefined structure like that.

          A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

          D S 2 Replies Last reply
          0
          • B Bob Stanneveld

            int arr[1][1][1]; perhaps... But I can't help to think that a better way to store time is in a structure like this: struct TIME { int m_nSeconds; int m_nMinutes; int m_nHours; }; There probably is a predefined structure like that.

            A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Bob Stanneveld wrote: There probably is a predefined structure like that. Several, actually.


            "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

            1 Reply Last reply
            0
            • B Bob Stanneveld

              int arr[1][1][1]; perhaps... But I can't help to think that a better way to store time is in a structure like this: struct TIME { int m_nSeconds; int m_nMinutes; int m_nHours; }; There probably is a predefined structure like that.

              A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

              S Offline
              S Offline
              Supaflyfrank
              wrote on last edited by
              #6

              I will look in to see if their is any structure already made. But I was more thinking of a array like this: int Time[3]; Time[0] Would be hours Time[1] Would be minutes and Time[2] Would be seconds.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups