Thread overview | ||||||
---|---|---|---|---|---|---|
|
June 05, 2003 Random numbers | ||||
---|---|---|---|---|
| ||||
rand() and RAND_MAX don't seem to be available, or are they? What is the equivalent of cstdlib.h? |
June 05, 2003 Re: Random numbers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Monk | 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
|
June 06, 2003 Re: Random numbers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heinz Saathoff | 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 |
June 06, 2003 Re: Random numbers | ||||
---|---|---|---|---|
| ||||
Posted in reply to Greg Peet | 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
|
Copyright © 1999-2021 by the D Language Foundation