c++ - Random numbers
- Monk (2/2) Jun 04 2003 rand() and RAND_MAX don't seem to be available, or are they? What is the
-
Heinz Saathoff
(4/6)
Jun 05 2003
You include either
or , but not (hope - Greg Peet (9/15) Jun 06 2003 Prepended header files with 'c' indicate the standardized ruling for usi...
-
Heinz Saathoff
(6/13)
Jun 06 2003
The difference between
and in C++ is that all
rand() and RAND_MAX don't seem to be available, or are they? What is the equivalent of cstdlib.h?
Jun 04 2003
Monk schrieb...rand() and RAND_MAX don't seem to be available, or are they? What is the equivalent of cstdlib.h?You include either <stdlib.h> or <cstdlib>, but not <cstdlib.h> (hope this is true for DM). - Heinz
Jun 05 2003
Prepended header files with 'c' indicate the standardized ruling for using the C runtime library (standard portions) with C++. Thus time becomes <ctime> instead of <time.h>, <stdio.h> becomes <cstdio>, <stdlib.h> becomes <cstdlib>, etc. Are you writing in C or C++? If it's C++, there should be no .h (though you may sometimes, non-standard-ruled for some). Now if you are, take into account which Standard Library you are using. I've had some problems with namespaces with the SGI (which is why STLPort is available). "Heinz Saathoff" <hsaat bre.ipnet.de> wrote in message news:MPG.1949550a205d33d29896bd news.digitalmars.com...Monk schrieb...rand() and RAND_MAX don't seem to be available, or are they? What is the equivalent of cstdlib.h?You include either <stdlib.h> or <cstdlib>, but not <cstdlib.h> (hope this is true for DM). - Heinz
Jun 06 2003
Greg Peet schrieb...Prepended header files with 'c' indicate the standardized ruling for using the C runtime library (standard portions) with C++. Thus time becomes <ctime> instead of <time.h>, <stdio.h> becomes <cstdio>, <stdlib.h> becomes <cstdlib>, etc. Are you writing in C or C++? If it's C++, there should be no .h (though you may sometimes, non-standard-ruled for some). Now if you are, take into account which Standard Library you are using. I've had some problems with namespaces with the SGI (which is why STLPort is available).The difference between <cname> and <name.h> in C++ is that all identifiers (except macros) are in namespace std when <cname> is included and in global namespace if <name.h> is included. For now I still use the 'original' c-headers (old men move slowly <g>). - Heinz
Jun 06 2003