博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
好好学习
bilbo.cublog.cn
管理博客
发表文章
留言
收藏夹
· Compiler
· Unix_Linux
博客圈
音乐
相册
文章
· AutoHotKey
· C/C++
· Caml
· Perl
· Tcl & Expect
· 其他编程语言
· Visual Language
· Compiler Engineering
· Embedded System
· Formal methods
· FieldBus
· Networking
· Hardware Desing
· Safety System
· Unix_Linux
· Software Engineering
· GSM/GSM-R
· 技术幽默
· 读书时间
· Good Resource
· 关注社会
· 胡言乱语
首页
关于作者
姓名:你知道 职业:IT 年龄:每年大一岁 位置:地球 个性介绍:挺笨 Email: bilbo0214@163.com
||
<<
>>
||
我的分类
文章列表 - C/C++
(转)METAKIT C++ TUTORIAL
<p><font size="5" color="#800000"><b><u>METAKIT C++ TUTORIAL</u></b></font> <br> Riccardo Cohen (rcohen at articque dot com) <br> articque (<a href="http://www.articque.com/">www.articque.com</a>) <br> Date : 19 Septembre 2003</p> <!--****************************************************--> <p><font size="5"><b><u>1) Introduction</u></b></font></p> <p>The metakit database has many interesting and innovative features that will not be described here. Please read Metakit web page : <a href="http://www.equi4.com/metakit">http://www.equi4.com/metakit</a>.</p> <p>Here I'll present my own vision of what one should understand to starting developping with the C++ api.</p> <!--****************************************************--> <p><font size="5"><b><u>2) Think different</u></b></font></p> <ul class="noindent"><li type="disc">We don't speak about tables and fields, but instead Views and Properties</li><li>Views are dynamic, you dont really separate structure from proces……
查看全文
发表于:2008-09-21 ┆
阅读(132)
┆
评论(0)
创建DevPak包的方法(附自制gcc-objective-c 3.4.5安装包)
<table style="border-collapse: collapse;" width="360" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0"> <tbody><tr height="60"><td width="60" align="center"><img src="/fileicon/pdf.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody><tr height="20"><td width="40" align="center">文件:</td><td>创建DevPak包的两种方法.pdf</td></tr> <tr height="20"><td width="40" align="center">大小:</td><td>250KB</td></tr> <tr height="20"><td width="40" align="center">下载:</td><td><a href="http://blogimg.chinaunix.net/blog/upfile2/080914225721.pdf">下载</a></td></tr> </tbody></table> </td></tr> </tbody></table> <br><br><br><table style="border-collapse: collapse;" width="360" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0"> <tbody><tr height="60"><td width="60" align="center"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> ……
查看全文
发表于:2008-09-14 ┆
阅读(81)
┆
评论(0)
Objective-C on Win32
在Windows下使用Objective-C可以有几种方法:<br><br>方法1:<br><ol><li>首先至 <a href="http://www.gnustep.org/">GNUstep的网站</a>download<a href="ftp://ftp.gnustep.org/pub/gnustep/binaries/windows">最新的 installer</a>。</li><li>安装installer。</li><li>打开msys。 </li><li>在 home\Administrator directory 下建立一个名字为.profile的文件,内容如下:<br> <pre>export OBJC_INCLUDE_PATH=/c/GNUstep/GNUstep/System/Library/Headers/<br>export LIBRARY_PATH=/c/GNUstep/GNUstep/System/Library/Libraries/<br></pre></li><li>重新启动msys,或是在命令行下执行下面的命令: <pre>source ~/.profile<br></pre> </li><li><pre>gcc -o test.exe test.m -lobjc<br></pre></li></ol>方法2:<br> 1. 从Mingw网站下载gcc-objc-3.4.5-xxxx.tar.gz。<br><br><table style="border-collapse: collapse;" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0" width="360"> <tbody><tr height="60"><td style="text-align: left;" width="60"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> ……
查看全文
发表于:2008-08-31 ┆
阅读(201)
┆
评论(0)
(转)C/C++ in 5 days
<table style="border-collapse: collapse;" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0" width="360"> <tbody><tr height="60"><td align="center" width="60"><img src="/fileicon/pdf.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr height="20"><td align="center" width="40">文件:</td><td>c_c++_in_five_days.pdf</td></tr> <tr height="20"><td align="center" width="40">大小:</td><td>161KB</td></tr> <tr height="20"><td align="center" width="40">下载:</td><td><a href="http://blogimg.chinaunix.net/blog/upfile2/080823212841.pdf">下载</a></td></tr> </tbody></table> </td></tr> </tbody></table>
查看全文
发表于:2008-08-23 ┆
阅读(128)
┆
评论(0)
(转)Reading C type declarations
<p> Even relatively new C programmers have no trouble reading simple C declarations such as </p> <pre class="codeblock"><span class="decl">int foo[5]; </span>// <i>foo is an array of 5 ints</i><br><span class="decl">char *foo; </span>// <i>foo is a pointer to char</i><br><span class="decl">double foo(); </span>// <i>foo is a function returning a double</i> </pre> <p> but as the declarations get a bit more involved, it's more difficult to know exactly what you're looking at. </p> <pre class="codeblock"><span class="decl">char *(*(**foo[][8])())[]; </span>// <i>huh ?????</i> </pre> <p> It turns out that the rules for reading an arbitrarily-complex C variable declaration are easily learned by even beginning programmers (though how to actually <i>use</i> the variable so declared may be well out of reach). </p> <p> This Tech Tip shows how to do it. </p> <h1 id="types">Basic and Derived Types</h1> <p> In addition to one variable n……
查看全文
发表于:2008-07-23 ┆
阅读(138)
┆
评论(0)
"Portability"
<h1>What is "Portability"?</h1> <p> The notion of "portability" is widely used, and it's often attached to software inappropriately. Software is only "portable" if it can actually be moved to a <i>different</i> platform, and these are some of the issues that are considered when a port is imminent. </p> <dl class="defnlist"><dt>CPU Architecture Portability </dt><dd>The differences underlying CPU architecture exposes itself in many ways to the C programmer, and these can erupt in surprising and disturbing ways. We can touch on a few of these here: <dl><dt><b>Wordsize</b> </dt><dd><img src="http://www.unixwiz.net/images/port-wordsize.gif" alt="[Wordsize]" align="right" height="72" width="216"> Modern machines are typically 16, 32 or 64 bits for their "natural" words, and the scalar variables <tt>short</tt>, <tt>int</tt> and <tt>long</tt> have varying sizes. Portable software does not typically rely on an integer being larger than 16 bits: a <tt>long</tt> must be……
查看全文
发表于:2008-07-23 ┆
阅读(145)
┆
评论(0)
bit-stuffing in C
<div align="center"><img src="http://blogimg.chinaunix.net/blog/upfile2/080707173503.jpg" onload="javascript:if(this.width>500)this.width=500;" border="0"></div> <br><div style="text-align: left;">bit-stuffing在HDLC中有应用,如果不使用HDLC芯片解析,则需要自己来处理。<br>下面是bit-stuffing的简单实现。<br><pre><code><span style="font-family: Courier New; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><span class="cpp1-reservedword">int</span><span class="cpp1-space"> bit_stuffing(<br> </span><span class="cpp1-reservedword">unsigned</span><span class="cpp1-space"> </span><span class="cpp1-reservedword">char</span><span class="cpp1-space"> *psrc, </span><span class="cpp1-comment">/* source buffer */<br></span><span class="cpp1-space"> </span><span class="cpp1-reservedword">unsigned</span><span class="cpp1-space"> </span><span class="cpp1-reservedword">short</span><span ……
查看全文
发表于:2008-07-07 ┆
阅读(208)
┆
评论(0)
portable vs. non-portable code example
<div class="Section1"> <p class="MsoNormal"><span style="font-family: 宋体;">不可移植的代码例子</span>:</p> <p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> <p class="MsoNormal"><span style="color: red;">typedef struct Version {<o:p></o:p></span></p> <p class="MsoNormal"><span style="color: red;"><span style=""> </span>INT16U Ver;<o:p></o:p></span></p> <p class="MsoNormal"><span style="color: red;">} CFGFILEVER;</span></p> <p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> <p class="MsoNormal">const INT16U RELEASE_VERSION = 0x8801;</p> <p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> <p class="MsoNormal">CFGFILEVER<span style=""> </span>*pCfgVer = NULL;<span style=""> </span>/* pointer to version */</p> <p class="MsoNormal"><!--[if !supportEmptyParas]--> <!--[endif]--><o:p></o:p></p> <p class="Mso……
查看全文
发表于:2008-07-03 ┆
阅读(154)
┆
评论(0)
(转)A Device Driver for W2K Signals
<div style="margin-left: 40px;"><font size="5">A Device Driver for W2K Signals</font> <p> <font size="4">Unix signals provide a simple IPC that is also asynchronous - your signal handler gets invoked when the signal arrives, no matter what your code was in the middle of. Achieving the same effect under Windows 2000 requires a device driver, so that you can make use of asynchronous procedure calls (APCs).</font><br> </p><p> <font face="geneva,arial,helvetica" size="2">By Panagiotis E., <!-- remove http:// substring (if present) from the url --> <a href="http://www.ddj.com/;jsessionid=ZVNGO1O0RCIMUQSNDLRSKH0CJUNN2JVN" target="_blank"> Dr. Dobb's Journal ……
查看全文
发表于:2008-06-03 ┆
阅读(263)
┆
评论(0)
RAD C++ Library 2.0下载
<table style="border-collapse: collapse;" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0" width="360"> <tbody><tr height="60"><td align="center" width="60"><img src="/fileicon/zip.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr height="20"><td align="center" width="40">文件:</td><td>radcpp2.0.mingw-gcc.zip</td></tr> <tr height="20"><td align="center" width="40">大小:</td><td>219KB</td></tr> <tr height="20"><td align="center" width="40">下载:</td><td><a href="http://blogimg.chinaunix.net/blog/upfile2/080523230320.zip">下载</a></td></tr> </tbody></table> </td></tr> </tbody></table><br>RAD C++库已经升级到了2.0,不过其正式的页面上还没有提供下载,只有forum中有链接。<br>收一个在自己的blog上以备不时之需。<br>
查看全文
发表于:2008-05-23 ┆
阅读(183)
┆
评论(0)
(转)How To Read C Declarations
<div> <p>Even experienced C programmers have difficulty reading declarations that go beyond simple arrays and pointers. For example, is the following an array of pointers or a pointer to an array?</p> <div class="code"> <div class="codeContent"><pre class="code-java"><span class="code-object">int</span> *a[10];</pre></div></div> <p>What the heck does the following mean?</p> <div class="code"> <div class="codeContent"><pre class="code-java"><span class="code-object">int</span> (*(*vtable)[])();</pre></div></div> <p>Naturally, it's a <em>pointer to an array of pointers to functions returning integers</em>. <img class="emoticon" alt="" src="http://www.antlr.org/wiki/images/icons/emoticons/wink.gif" align="absmiddle" border="0" height="20" width="20"></p> <p>This short article tells you how to read any C declaration correctly using a very simple technique. I am 99% certain that I read this in a book in the late 1980s, but I can't remember where. I doubt that I discovered this o……
查看全文
发表于:2008-02-26 ┆
阅读(362)
┆
评论(0)
Dev-C++下编译COM程序出错的原因及解决
<div>在CodeProject上看到一篇关于使用C写COM程序的文章<a href="http://www.codeproject.com/com/com_in_c1.asp">http://www.codeproject.com/com/com_in_c1.asp</a>,把代码下载下来后进行测试。</div> <div> </div> <div>因为都是Visual Stdio的project,使用Dev-C++的导入功能,把项目转换成Dev-C++项目,编译都没有错误,但运行测试程序总是提示CoGetClassObject()执行结果有错误。</div> <div> </div> <div>hr = CoGetClassObject(&CLSID_IExample, CLSCTX_INPROC_SERVER, 0, &IID_IClassFactory, &classFactory)</div> <div>执行完成后,hr的值是CO_E_ERRORINDLL,即0x8004_01f9。事实上,COM对象已经注册成功。</div> <div>Microsoft网站上<a href="http://support.microsoft.com/kb/258942/zh-cn">http://support.microsoft.com/kb/258942/zh-cn</a>提供了解决方法,其实主要是在链接选项里面加入/DEF:<DEF文件名></div> <div> </div> <div>因为Dev-C++导入时不是自动加入这个选项,需要手动加入,如Dev-C++中的FAQ所述:</div> <div> <h2><a name="dll">How can i provide a .def file for my DLL ?</a></h2>Put in……
查看全文
发表于:2007-11-29 ┆
阅读(684)
┆
评论(0)
(转)make的常见错误信息
<div> <p class="MsoNormal" style="text-indent: 24pt; line-height: 150%; text-align: justify;"><span style="font-size: 12pt; color: black; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: 楷体_GB2312;">执行过程中所产生错误并不都是致命的;特别是在命令行之前存在“</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: Arial;" lang="EN-US">-</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: 楷体_GB2312;">”、或者</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: 楷体_GB2312;">使用“</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: Arial;" lang="EN-US">-k</span><span style="font-size: 12pt; color: black; line-height: 150%; font-family: 楷体_GB2312;">”选项执行时。</spa……
查看全文
发表于:2007-11-09 ┆
阅读(584)
┆
评论(0)
FLTK入门文章
<div>不废话了,直接链接过去吧。</div> <div> </div> <div>FLTK编程模型</div> <div><a href="http://www.ibm.com/developerworks/cn/linux/l-fltk/index.html">http://www.ibm.com/developerworks/cn/linux/l-fltk/index.html</a></div> <div> </div> <div>Beginner Tutorial</div> <div><a href="http://www3.telus.net/public/robark/">http://www3.telus.net/public/robark/</a></div> <div> </div> <div>Ruby/FLTK</div> <div><a href="http://ruby-fltk.sourceforge.net/">http://ruby-fltk.sourceforge.net/</a></div> <div> </div> <div>Lua FLTK</div> <div><a href="http://lua-fltk.sourceforge.net/">http://lua-fltk.sourceforge.net/</a></div> <div> </div> <div>Another FLTK tutorial</div> <div><a href="http://www.cs.wisc.edu/graphics/Courses/559-f2001/Notes/fltktut.html">http://www.cs.wisc.edu/graphics/Courses/559-f2001/Notes/fltktut.html</a></div> <div> </div> <div><font size="2">GUi programming with FLTK</font></div> <div><a href="http://www.gidforums.com/t-2155.html"……
查看全文
发表于:2007-07-04 ┆
阅读(753)
┆
评论(0)
推荐一个讲Dev-C++的blog
在CSDN上看到的。<span style="font-size: 10pt; font-family: "Times New Roman";" lang="EN-US">http://blog.csdn.net/visioncat<br><br></span><strong><span style="font-size: 13.5pt; font-family: Arial;" lang="EN-US">有 Dev-Cpp/Mingw32</span><span style="font-size: 13.5pt;" lang="EN-US"> </span></strong><strong><span style="font-size: 13.5pt; font-family: 宋体;">环境介绍连载14篇,写得不错,故推荐之。<br><br>也可以从本blog上下载整理后的版本</span></strong><table style="border-collapse: collapse;" align="center" border="1" bordercolor="#dddddd" cellpadding="0" cellspacing="0" width="360"> <tbody><tr height="60"><td align="center" width="60"><img src="/fileicon/rar.gif" alt="" border="0"></td><td> <table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr height="20"><td align="center" width="40">文件:</td><td>gcc.rar</td></tr> <tr height="20"><td align="center" width="40">大小:</td><td>455KB</td></tr> <tr height="20"><……
查看全文
发表于:2007-06-28 ┆
阅读(1003)
┆
评论(0)
C programmer, Attention!
<div>收集一些C的死角问题及坏书的列表,共享一下。</div> <div></div> <div></div> <div> </div> <div>Criticism of the C programming language</div> <div><a href="http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language">http://en.wikipedia.org/wiki/Criticism_of_the_C_programming_language</a></div> <div></div> <div></div> <div> </div> <div>Infrequently Asked Questions List</div> <div><a href="http://www.plethora.net/%7Eseebs/faqs/c-iaq.html">http://www.plethora.net/~seebs/faqs/c-iaq.html</a></div> <div> </div> <div>Bad C books list</div> <div><a href="http://www.cs.technion.ac.il/users/yechiel/CS/BadBooksC+C++.html">http://www.cs.technion.ac.il/users/yechiel/CS/BadBooksC+C++.html</a></div> <div> </div> <div>C选书指南</div> <div><a href="http://www.cs.technion.ac.il/users/yechiel/CS/ChoosingBooks.html">http://www.cs.technion.ac.il/users/yechiel/CS/ChoosingBooks.html</a></div> <div> </div> <div>Other C Nuances</div> <div><a href="http……
查看全文
发表于:2007-06-21 ┆
阅读(602)
┆
评论(0)
使用Dev-C++编写调用perl的C程序
<div>在网络上看到一篇将如何在C程序中嵌入perl的文章<a href="http://www.fnal.gov/docs/products/perl/pod.new/5.00503/pod/perlembed.html#Embedding_Perl_under_Win32">http://www.fnal.gov/docs/products/perl/pod.new/5.00503/pod/perlembed.html#Embedding_Perl_under_Win32</a>,因为不太习惯使用Visual Stdio,机器上也没有安装,所以就试验了一下如何使用Dev-C++进行替代,过程很简单。</div> <div> </div> <div>先建立一个Project,然后加入源文件,这里使用一个上文中的例子:</div> <div> #include <EXTERN.h><br> #include <perl.h><br> <br> static PerlInterpreter *my_perl;<br> <br> main (int argc, char **argv, char **env)<br> {<br> STRLEN n_a;<br> char *embedding[] = { "", "-e", "0" };<br> <br> my_perl = perl_alloc();<br> perl_construct( my_perl );<br>&nb……
查看全文
发表于:2007-06-20 ┆
阅读(982)
┆
评论(0)
最令人郁闷的Bug
今天加了一整天的班就因为两个Bug,郁闷死了。<br>因为将旧项目中的库移植到新的项目中,增加新的功能同时又要向前兼容,本以为编译通过就OK了,结果还是调了一天,总计发现两个bug。一个Bug是因为修改后的代码忘记调用一个初始化函数,导致读取设备状态产生死循环,另一个bug是因为以前修改时直接使用数字而不是宏作为缓冲区的长度,结果结构体长度修改后,缓冲区长度却没变,清缓冲区越界,把其他的数据区也清掉了,导致网络发送死循环。<br>分析起来都是很容易避免的问题,而且这样的错误犯过不止一次,教训惨痛呀。<br><br>时刻牢记教训:<br>1、坚决抵制不可移植的代码;<br>2、使用宏定义常数,不使用显示的数字;<br>3、设备操作不能使用死循环设计,应该采用超时加返回状态的方法检测是否正常;<br>4、函数如果没有被调用就没有存在的必要,删除一切用不到的代码。<br><br>牢记,牢记。<br>
查看全文
发表于:2007-06-16 ┆
阅读(1098)
┆
评论(2)
最简单的串口发送程序(C语言)
在Dev-C++的论坛中看到的,适用于Windows平台,主要是使用了操作系统的mode命令设置串口,然后像使用文件一样操作串口。<br><br>#include <stdio.h><br>#include <stdlib.h><br><br>int main()<br>{<br> FILE* portfp; <br> <br> system("mode com1: baud=115200 parity=n data=8 stop=1 to=off xon=off"); <br> portfp = fopen("com1", "wb+"); <br> <br> fprintf(portfp, "Hello, world!\n") ; <br> fclose(portfp); <br> <br> return(0);<br>}<br><br>mode配置串口说明如下:<br><br> <h4><span style="font-family: 宋体;">配置串行通讯端口</span></h4> <h5><span style="font-family: 宋体;">语法</span></h5> <p><b><span lang="EN-US">modecom</span></b><i><span lang="EN-US">M</span></i><span lang="EN-US">[<b>:</b>] [<b>baud=</b><i>B</i>] [<b>parity=</b><i>P</i>] [<b>data=</b><i>D</i>] [<b>stop=</b><i>S</i>] [<b>to=</b>{<b>on</b……
查看全文
发表于:2007-06-14 ┆
阅读(1095)
┆
评论(0)
gcc的
<div>今天检查一个同事写的程序,主要问题是编译器报“storage class specified for parameter ”的错误,可是看报错的位置并没有什么错误,查了半天才发现是一个头文件中的一个函数声明少写了一个分号“;”。</div> <div> </div> <div>这个错误虽然很小,但检查起来不是很容易,主要原因我觉得还是gcc做语法检查的时候进行了过多的错误处理,忽略了识别不了的token,这样错误被累计导致产生这个报警信息。</div> <div> </div> <div>下面的代码就显示了这个报警出现的例子:</div> <div>int func1()</div> <div>class unsigned short c;<br>int main()<br>{<br> return(0);<br>}</div> <div>如果func1()的函数声明在其它文件,检查起来就麻烦的多。</div> <div> </div> <div>不过以后出现这种错误可以有经验了,检查错误之间所有的代码和被包含的文件。</div>
查看全文
发表于:2007-05-11 ┆
阅读(1040)
┆
评论(4)