how to convert type clock_t value to char
I am using the value clock_t in my C program, and the related function clock(). The problem is that I need to display the value of clock_t variables and I can only do it in charcter type as I am displaying it in openGL with my own custom function for displaying which only takes char type string. Please help me.
Secondly what type of a function can I use to delay execution for some time. I have tried to used sleep and delay and have added the header file DOS.H. But the compiler still doesnt recognize the calls to sleep() or delay(). My program is in c++.
Re: how to convert type clock_t value to char
Quote:
Originally posted by onlyhuman23
I am using the value clock_t in my C program, and the related function clock(). The problem is that I need to display the value of clock_t variables and I can only do it in charcter type as I am displaying it in openGL with my own custom function for displaying which only takes char type string. Please help me.
localtime(time_t*) returns the string that you probably want
Quote:
Secondly what type of a function can I use to delay execution for some time. I have tried to used sleep and delay and have added the header file DOS.H. But the compiler still doesnt recognize the calls to sleep() or delay(). My program is in c++.
sleep() is a unix function, and Sleep() is a Win32 API function. Neither are available to MS-DOS 16-bit programs. I don't know what delay() is. What compiler are you using?