Questions in category: C++ (C++)
软件 >> C++ [35]
<[1] [2] [3] [4] >

31. 关于C++中的 rand 和 srand 函数

Posted by haifeng on 2014-03-06 09:27:38 last update 2014-03-06 09:34:19 | Answers (0) | 收藏


打开文件 stdlib.h (如果安装的是 Code::Blocks, 则位于 C:\Program Files\CodeBlocks\MinGW\include 中)

cstdlib, ctime 等位于 C:\Program Files\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++

/*
 * RAND_MAX is the maximum value that may be returned by rand.
 * The minimum is zero.
 */
#define	RAND_MAX	0x7FFF

_CRTIMP int __cdecl __MINGW_NOTHROW	rand	(void);
_CRTIMP void __cdecl __MINGW_NOTHROW	srand	(unsigned int);

 


References:

C++ Random Numbers

 

32. 枚举 enum

Posted by haifeng on 2014-03-02 14:25:04 last update 2014-03-02 14:25:04 | Answers (0) | 收藏


C++ 中 enum 的使用, 例如

enum {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}

则整数常量 Sunday, Monday, Tuesday,..., Saturday 按默认方式依次被赋值为 0,1,2,...,6.

 

也可以为枚举命名. 例如

enum Months{January, February, March, April, May, June, July, August, September, October, November, December}

 

34. C++ 学习站点

Posted by haifeng on 2013-03-05 00:00:59 last update 2015-01-15 09:50:49 | Answers (0) | 收藏


http://www.cplusplus.com

 

 

中国 IT 实验室

http://c.chinaitlab.com/

VC 知识库

http://vckbase.com/

C++、Java、算法教程

http://www.cstutoringcenter.com/tutorials/

俄罗斯的一个站点

http://netcode.ru/?lang=cpp

 

35. Global Variable Editor

Posted by haifeng on 2012-09-19 17:27:59 last update 2012-09-19 17:42:00 | Answers (0) | 收藏


Base: E:\wxWidgets-2.8.11
include: E:\wxWidgets-2.8.11\include
lib: E:\wxWidgets-2.8.11\lib

Project build options-->

Compiler settings

Other options:

`wx-config --cflags -lsqlite3`

#defines

__GNUWIN32__

__WXMSW__

-----------------------------------

Linker settings

Link libraries:

libkernel32.a
libuser32.a
libgdi32.a
libwinspool.a
libcomdlg32.a
libadvapi32.a
libshell32.a
libole32.a
liboleaut32.a
libuuid.a
libcomctl32.a
libwsock32.a
libodbc32.a

other linker options:

`wx-config --libs`

---------------------

Search directories

Compiler:

(#wx)\include
(#wx)\contrib\include

Resource compiler:

(#wx)\include

<[1] [2] [3] [4] >