桑海

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  问题、实验

学习中遇到的问题与实验调试等
摘要:Debug和Release区别 转自草原和大树VC下Debug和Release区别最近写代码过程中,发现 Debug 下运行正常,Release 下就会出现问题,百思不得其解,而Release 下又无法进行调试,于是只能采用printf方式逐步定位到问题所在处,才发现原来是给定的一个数组未初始... 阅读全文
posted @ 2014-09-02 11:16 桑海 阅读(220) 评论(0) 推荐(0)

该文被密码保护。
posted @ 2014-08-26 20:06 桑海 阅读(0) 评论(0) 推荐(0)

摘要:1 error C2572: “****”: 重定义默认参数 : 参数 12 3 默认参数只需在声明原型时使用,定义的时候就不需要。error C2572 阅读全文
posted @ 2014-08-24 19:50 桑海 阅读(138) 评论(0) 推荐(0)

摘要:转自:Ubuntu kill命令用法详解1. kill作用:根据进程号杀死进程用法: kill [信号代码] 进程IDroot@fcola:/#ps -ef | grep sendmailsmmsp 14354 14337 0 00:08 pts/1 00:00:00 sendmail startsmmsp 14356 3154 0 00:08 pts/0 00:00:00 sendmail -ssmmsp 14359 3154 0 00:09 pts/0 00:00:00 sendmail startsmmsp 14360 14337 0 00:09 pts/1 00:00:... 阅读全文
posted @ 2013-09-12 15:48 桑海 阅读(4267) 评论(0) 推荐(0)

摘要:安装失败;直接重启后进入原系统蓝屏提示失败开机F1进入BIOS-〉config-〉Serial ATA-〉将硬盘模式从AHCI改为Compatibility。这项很重要的。可以解决以上问题; 阅读全文
posted @ 2013-09-03 09:31 桑海 阅读(149) 评论(0) 推荐(0)

摘要:Bign 1 #include<iostream> 2 #include<string> 3 #include<cstring> 4 #include<cstdio> 5 using namespace std; 6 const int maxn = 1000 + 5; 7 8 class bign 9 { 10 public: 11 int len, s[maxn]; 12 bign() 13 { 14 len = 0; 15 memset(s, 0, sizeof(s)); 16 ... 阅读全文
posted @ 2013-04-04 17:05 桑海 阅读(3581) 评论(0) 推荐(0)

摘要:runtimeerror(运行时错误)就是程序运行到一半,程序就崩溃了。比如说:①除以零②数组越界:inta[3];a[10000000]=10;③指针越界:int*p;p=(int*)malloc(5*sizeof(int));*(p+1000000)=10;④使用已经释放的空间:int*p;p=(int*)malloc(5*sizeof(int));free(p);*p=10;⑤数组开得太大,超出了栈的范围,造成栈溢出:inta[100000000];如果你用的是WindowsXP操作系统,那么RuntimeError的界面一般如下: 阅读全文
posted @ 2013-04-03 20:36 桑海 阅读(348) 评论(0) 推荐(0)

摘要:转自:VincentCZW1.qsort函数:原型:void qsort(void *base, int nelem, int width, int (*fcmp)(const void *,const void *));功能:使用快速排序例程进行排序参 数:1 待排序数组首地址2 数组中待排序元素数量3 各元素的占用空间大小4 指向函数的指针,用于确定排序的顺序说明:qsort函数是ANSI C标准中提供的,其声明在stdlib.h文件中,是根据二分法写的,其时间复杂度为n*log(n)。qsort要求提供的函数是需要自己定义的一个比较函数,比较函数使得qsort通用性更好。有了比较函数qs 阅读全文
posted @ 2013-02-24 14:53 桑海 阅读(253) 评论(0) 推荐(0)

摘要:#include<iostream>#include<cstring>using namespace std;void out(char str[]){ for(int i = 0; str[i] != '\0'; ++i) cout << str[i]; cout << endl;}void f(char str[]){ out(str); memset(str, '0', sizeof(str)); out(str);}int main(){ char str[10] = "123456"; 阅读全文
posted @ 2012-12-29 23:12 桑海 阅读(824) 评论(0) 推荐(0)

摘要:抠佽了一天就弄了这个:还不错总算是弄出来了。希望有建议和补充:我的CSDN博客链接:桑海的CSDN博客 1 #include<iostream> 2 #include<sstream> //stringstream 3 #include<cstdio> //sscanf,sprintf() 4 using namespace std; 5 6 int main() 7 { 8 //*************************************************block1*********************************** 阅读全文
posted @ 2012-11-17 23:46 桑海 阅读(5070) 评论(0) 推荐(1)

摘要:一下是C++Primer中“流状态的查询和操作”的例题: 1 #include<iostream> 2 #include<limits> 3 using namespace std; 4 5 int main() 6 { 7 int ival; 8 while(cin >> ival, !cin.eof()) //必须输入两个文件结束符才可以结束输入??? 9 {10 if(cin.bad()) //input stream is corrupted; bail out11 throw runtime... 阅读全文
posted @ 2012-11-12 17:08 桑海 阅读(288) 评论(0) 推荐(0)