![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
精炼程序
manji520
这个作者很懒,什么都没留下…
展开
-
随机数产生的三种算法
/*从同一个种子开始*/ #include #include static unsigned long int next=1; int rand0(void) { next=next*1103515245+12345; return (unsigned int)(next/65536)%32768; } int main(void) { int count; for(count=0;coun转载 2008-07-15 16:08:00 · 985 阅读 · 0 评论 -
高质量C++/C程序设计指南
第6章 函数设计函数是C++/C程序的基本功能单元,其重要性不言而喻。函数设计的细微缺点很容易导致该函数被错用,所以光使函数的功能正确是不够的。本章重点论述函数的接口设计和内部实现的一些规则。 函数接口的两个要素是参数和返回值。C语言中,函数的参数和返回值的传递方式有两种:值传递(pass by value)和指针传递(pass by pointer)。C++ 语言中多了引用传递(pass b转载 2008-07-15 15:36:00 · 471 阅读 · 0 评论