上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页
摘要: (转载)http://blog.csdn.net/allenlinrui/article/details/5964046可以使用examine命令(简写是x)来查看内存地址中的值。x命令的语法如下所示:x/<n/f/u> <addr>n、f、u是可选的参数。(1)n是一个正整数,表示需要显示的内存单元的个数,也就是说从当前地址向后显示几个内存单元的内容,一个内存单元的大小由后面的u定义。(2)f 表示显示的格式,参见下面。如果地址所指的是字符串,那么格式可以是s,如果地十是指令地址,那么格式可以是i。(3)u 表示从当前地址往后请求的字节数,如果不指定的话,GDB默认是 阅读全文
posted @ 2013-05-16 18:03 robotke1 阅读(3022) 评论(0) 推荐(0)
摘要: (转载)http://healthy.4738.com/20120615/249229.html导读:燕麦是十分有营养的补品,其营养丰富,且十分美味,那你知道燕麦有什么营养价值吗?一起来看看吧! 燕麦的营养分析: 1. 经常食用燕麦对糖尿病患者也有非常好的减肥、降糖的功效; 2. 燕麦经常食用,可以有效地降低人体中的胆固醇,即可对中老年人的主要威胁——心脑血管病起到一定的预防作用; 3. 它还可以缓解生活工作带来的压力,改善血液循环;含有的磷、钙、锌、铁等矿物质有预防骨质疏松、促进防止贫血、伤口愈合的功效,是补钙佳品; 4. 燕麦粥有通大便的作用,燕麦能解便秘,很多老年人大便干,... 阅读全文
posted @ 2013-05-15 20:23 robotke1 阅读(161) 评论(0) 推荐(0)
摘要: (转载)http://www.360doc.com/content/12/0824/20/8093902_232153101.shtml#include <iostream>using namespace std;int main(int argc, char *argv[]){ const int a = 10; int *p = (int *) &a;//让p指向与a相同的内存空间 cout << *p << " " << a << endl; cout << p << &quo 阅读全文
posted @ 2013-05-15 18:25 robotke1 阅读(272) 评论(0) 推荐(0)
摘要: (转载)http://blog.chinaunix.net/uid-11861796-id-2813603.htmlstrtok()这个函数大家都应该碰到过,但好像总有些问题, 这里着重讲下它首先看下MSDN上的解释:char *strtok( char *strToken, const char *strDelimit );ParametersstrTokenString containing token or tokens.strDelimitSet of delimiter characters.Return ValueReturns a pointer to the next toke 阅读全文
posted @ 2013-05-15 17:43 robotke1 阅读(325) 评论(0) 推荐(0)
摘要: C语言:#include <stdio.h>#include <stdlib.h>#include <string.h>int main(int argc, char* argv[]){ int count = 0; FILE* fp; char str[100]; fp = fopen("test.txt", "r"); while (fscanf(fp, "%s", str) != EOF) { printf("%s\n", str); count++; } fclose(f 阅读全文
posted @ 2013-05-15 17:05 robotke1 阅读(17546) 评论(0) 推荐(0)
摘要: C语言读取文件的一行:#include <stdio.h>#include <stdlib.h>#include <string.h>#define MAX_LINE 200int main(int argc, char* argv[]){ FILE* fp; char buffer[MAX_LINE]; fp = fopen("test.txt", "r"); if (fp == NULL) { perror("File open"); exit(1); } while (fgets(buffer 阅读全文
posted @ 2013-05-15 13:14 robotke1 阅读(1157) 评论(0) 推荐(0)
摘要: 例子:#include <iostream>#include <string>using namespace std;int main(int argc, char** argv){ ifstream ifs("test.txt"); string str; while (getline(ifs, str)) { cout << str << endl; } return 0;}程序输出:~ # gcc test.cpptest.cpp: In function ‘int main(int, char**)’:test.cpp 阅读全文
posted @ 2013-05-15 12:58 robotke1 阅读(1709) 评论(0) 推荐(0)
摘要: (转载)http://www.cnblogs.com/dolphin0520/archive/2011/04/04/2005089.htmlC语言:#include <stdio.h>int main(int argc, char* argv[]){ char ch = 'a'; printf("%d\n", sizeof(char)); printf("%d\n", sizeof(ch)); printf("%d\n", sizeof('a')); return 0;}程序输出:C++语言 阅读全文
posted @ 2013-05-15 12:20 robotke1 阅读(195) 评论(0) 推荐(0)
摘要: (转载)http://www.cnblogs.com/dolphin0520/archive/2011/08/24/2151846.html KMP算法在介绍KMP算法之前,先介绍一下BF算法。一.BF算法 BF算法是普通的模式匹配算法,BF算法的思想就是将目标串S的第一个字符与模式串P的第一个字符进行匹配,若相等,则继续比较S的第二个字符和P的第二个字符;若不相等,则比较S的第二个字符和P的第一个字符,依次比较下去,直到得出最后的匹配结果。 举例说明: S: ababcababa P:ababa BF算法匹配的步骤如下 i=0 i=1 ... 阅读全文
posted @ 2013-05-15 12:09 robotke1 阅读(221) 评论(0) 推荐(0)
摘要: (转载)http://www.cnblogs.com/simonhaninmelbourne/archive/2012/11/24/2786215.html前天俺们谈到了加锁,但是在使用加锁的同时又会带来一个问题,就是死锁。什么叫死锁?所谓死锁: 是指两个或两个以上的进程在执行过程中,因争夺资源而造成的一种互相等待的现象,若无外力作用,它们都将无法推进下去。那么为什么会产生死锁呢?1.因为系统资源不足。2.进程运行推进的顺序不合适。3.资源分配不当。学过操作系统的朋友都知道:产生死锁的条件有四个:1.互斥条件:所谓互斥就是进程在某一时间内独占资源。2.请求与保持条件:一个进程因请求资源而阻塞时 阅读全文
posted @ 2013-05-15 12:04 robotke1 阅读(203) 评论(0) 推荐(0)
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 54 下一页