Thread: Dynamic Memory
View Single Post
  #2   Spotlight this post!  
Unread 20-12-2009, 21:12
slavik262's Avatar
slavik262 slavik262 is offline
We do what we must because we can.
AKA: Matt Kline
FRC #0537 (Charger Robotics)
Team Role: Alumni
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Sussex, WI
Posts: 310
slavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to beholdslavik262 is a splendid one to behold
Send a message via AIM to slavik262
Re: Dynamic Memory

First of all, stdlib.h is part of the C Standard Library, and should exist on all C platforms. It has nothing to do with Windows. I remember something about Easy C not having implementations for dynamic memory management due to the very small scale of platforms they target.

To answer your second question, there's a header called time.h (or ctime if you're compiling in C++). In it there's a function called clock() which returns a value of type clock_t for how long the program has been running. To convert this into seconds, there is also a definition in clock.h called CLOCKS_PER_SEC which evaluates to the number of clock_t's per second. On the Windows platforms I've compiled on so far, CLOCKS_PER_SEC is 1000, meaning each clock_t value is a milisecond.

Feel free to PM me if I can help you in any other way, and welcome to Chief Delphi.
__________________

Last edited by slavik262 : 20-12-2009 at 21:19. Reason: Added additional info.