C/C++ Design
godspirits
迷途的我。
迷离的社会。
迷糊的产业链。
迷信的追求迷茫。
展开
-
【收藏】 sscanf 的高级用法
<br />sscanf() - 从一个字符串中读进与指定格式相符的数据.<br />函数原型:<br /> Int sscanf( string str, string fmt, mixed var1, mixed var2 ... );<br /> int scanf( const char *format [,argument]... );<br />头文件:<br />#i nclude<stdio.h><br />说明:<br /> sscanf与scanf类似,都是用于输入的,只是后者以键转载 2010-11-17 23:09:00 · 411 阅读 · 0 评论 -
三道题~~
第1题:char *pBuffer = NULL;char buffer[100];pBuffer = (char *)malloc(200);printf("pBuffer [%d], bufffer[%d]/n", sizeof(pBuffer), sizeof(buffer));-------------1. 以上打印的答案是什么?2. 为什么?第2题递归调用函数的局部变量是每次都从栈里面重新分配么? 还是要考虑可重入性??第3题 以下代码是否有误,运行效果如原创 2010-09-02 20:49:00 · 486 阅读 · 0 评论 -
自己备份的代码
FM的代码,自己mark下 ///////////////////////////////////////////////////////////////////////////////// System : WIBRO// Subsystem : OAM// Process : FM// Class : A原创 2009-04-07 17:14:00 · 724 阅读 · 0 评论 -
C/C++ linux 嵌入式相关 带答案的笔试题 汇总~~
1. 以下三条输出语句分别输出什么?char str1[] = "abc";char str2[] = "abc";const char str3[] = "abc"; const char str4[] = "abc"; const char* str5 = "abc";const char* str6 = "abc";cout 输出什么?cout 输出什么?cout 输出什么? 答:分别输原创 2009-03-28 11:31:00 · 5617 阅读 · 2 评论 -
Some test code designed by myself
The following source code are designed by my self to test some special operation. 转帖请把本文链接挂上~~ 1. 快速排序法 #include"stdio.h"struct mytype{ int wy;};void quickSort(int a[],int left,int r原创 2009-03-21 16:14:00 · 741 阅读 · 0 评论 -
过滤 外文unicode文本中字符的代码
Author: godspirit This source code is used for filtering unexpected character of a the unicode TXT document. And it will generate formated TXT. e.g. The chinese character would be kicked off from原创 2009-03-21 15:38:00 · 1333 阅读 · 0 评论 -
(转) 经典C语言算法 100例
【程序1】 题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少? 1.程序分析:可填在百位、十位、个位的数字都是1、2、3、4。组成所有的排列后再去 掉不满足条件的排列。 2.程序源代码: main() { int i,j,k; printf("/n"); for(i=1;i/*以下为三重循环*/ for(j=1;jfor (k=1;k{ if (i!=k&&i!=j转载 2009-02-27 22:52:00 · 807 阅读 · 0 评论 -
(转)理解虚基类、虚函数与纯虚函数的概念
原文:http://www.cnblogs.com/MS-Frank/archive/2008/01/16/1041310.html 引言 一直以来都没有写过一篇关于概念性的文章,因为我觉得这些概念性的东西书本上都有并且说的也很详细写来也无用,今天突发奇想想写一写,下面就和大家讨论一下虚基类、虚函数与纯虚函数,一看名字就让人很容易觉得混乱。不过不要紧待看完本文后你就会理解了。正文转载 2009-02-17 11:27:00 · 578 阅读 · 0 评论 -
An Introduction to Project Management
Simple and Concise way of understanding Project Management //By Duncan Haughey, PMP Project management in the modern sense began in the early 1960s, although it has its roots much further back i原创 2009-01-09 11:18:00 · 997 阅读 · 0 评论 -
C++入门10% 写的代码。。。
#include #include using namespace std;using namespace __gnu_cxx; int main(int argc , char * argv[]){ typedef pair PAIR; hash_map test; /*insert value*/ fo原创 2008-10-18 13:24:00 · 891 阅读 · 0 评论 -
strftime() 函数---> 时间格式化
strftime() 函数是一个很有用的时间格式化函数,主要用于将 time_t 中的数据计算获得各种形式的 字符串时间。我们可以使用strftime()函数将时间格式化为我们想要的格式。它的原型如下:size_t strftime( char *strDest, size_t maxsize, const char *format, const struct tm *time原创 2008-09-04 11:03:00 · 762 阅读 · 0 评论 -
baidu的题,分析,算法,编程(转)
2007年10月27日日面试baidu高程,惨败题目如下,给大家共勉:A厂有1万个工人,编号0-9999,( EE[10000] ), 1个厂长( GG )分派任务, 1个监工( MM )管理工人.厂子忙的时间不确定,可能突然很忙,1天接到任务5000多个,1个任务只能分配给1个工人做, 也可能好几十天没新任务.厂长分配任务给这1万个转载 2008-09-02 09:01:00 · 435 阅读 · 0 评论 -
16个嵌入式要点考题(转)...Advanced Test in C: The 0x10 Best Questions for C Programmers
/*embeddedsoft:这几个题目不是很难,但很基本,能在一定地层面上考查程序员对C的掌握情况,作者基本上对每个题目都作出了详细的解答,这些题目值得思考和借鉴!*/Advanced Test in C: The 0x10 Best Questions for C ProgrammersUsing this Test In the entire test following convent转载 2008-09-01 16:56:00 · 652 阅读 · 0 评论 -
陷阱的警示--逻辑运算符
A sample example of logical operator. int main(){ int a =1, b=2; if((a == 0)&& (b++)) printf("11/n"); printf("b = %d/n", b); if((a == 1) || (b++)) printf("22/n"); printf("b = %d/n", b); if((a =原创 2008-08-19 22:15:00 · 370 阅读 · 0 评论 -
while(0),, array[0]
1. do{ / code... ; / code...; /}while(0) Why do we use "do while(0)" : This macro define can check if the defined symbal are excueted as a whole. here is an example.if we define BST_DEB原创 2008-08-19 22:20:00 · 364 阅读 · 0 评论 -
开源代码TinyPTC推荐: X11- FrameBuffer-linux-键盘事件处理
推荐个开源软件,名字叫TinyPTC,sf.net可以下载。这个软件实现了framebuffer的功能,接口非常简单易用。 特别适合于将 嵌入式应用(如:机顶盒应用) 一直到Linux PC 桌面系统上的开发。FrameBuffer的实现有基于X11, xshm和其他的。下面说说我是咋用的吧。我用了两类:1. X11的: 用于将机顶盒应用移植到桌面系统上。机顶盒应用底层原创 2012-06-28 10:42:39 · 1443 阅读 · 0 评论