I have one library file missing, it should contain the following functions:
Can anyone tell me what library file is it? Maybe I even have it...Code:crypt
gettimeofday
srandom
random
Printable View
I have one library file missing, it should contain the following functions:
Can anyone tell me what library file is it? Maybe I even have it...Code:crypt
gettimeofday
srandom
random
Code:#include <stdlib.h>
stdlib.h is not standard.
useinstead.Code:#include <cstdlib>
[edit] for rand and srand, anyway. I don't know about the other two. [/edit]
yes cstdlib.h is the standard one...
....for C++ :D
this is the difference between c and c++. we're working with c++ so we would want to use
maybe they're both standard though...Code:#include <cstdlib>
you might want
and for the crypt function, i couldn't help youCode:#include <ctime>
anyway did that answer your question maxorator?
man cryptQuote:
Originally Posted by maxorator
man gettimeofday
man srandom
man random
>> stdlib.h is not standard.
Yes it is. It is standard in C++, but deprecated, meaning it will still work on all standards-compliant compilers now, but maybe not in a later version of the standard. You are right that <cstdlib> is preferred in C++.
>> yes cstdlib.h is the standard one...
There's no such thing as cstdlib.h, it is cstdlib or stdlib.h.
Of course, none of the names in the OP are from stdlib.h (or cstdlib) anyway, so it doesn't matter in this case.
> I have one library file missing, it should contain the following functions:
Your question is meaningless without you also telling us which OS/Compiler you have.
See the FAQ on what to do if you need "foo.h" but don't have it question.