易截截图软件、单文件、免安装、纯绿色、仅160KB

C: 面向对象(3)

以下代码演示如何用C来模拟多态。gcc版本:3.4.4
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#ifndef class
        #define class struct
#endif
#ifndef private
        #define private
#endif
#ifndef public
        #define public
#endif
#ifndef protected
        #define protected
#endif
#ifndef bool
        #define bool int
#endif
#ifndef true
        #define true 1
#endif
#ifndef false
        #define false 0
#endif
class Parent{
      //private members
      private class Parent *this;
      private size_t len;
     
      //public members
      public size_t (*length)(class Parent *this);
      public void (*construct)(class Parent *this);
      public void (*print)(class Parent *this);
      public void (*destruct)(class Parent *this);
};
class Son{
      //private members
      private class Son *this;
      //inherit
      private class Parent *inherit;
     
      //public members
      public size_t (*length)(class Son *this);
      public bool (*construct)(class Son *this);
      public void (*print)(class Son *this);
      public void (*destruct)(class Son *this);
};
//forward declaration
void ParentConstruct(class Parent *this);
void ParentPr


相关文档:

linux内核移植s3c2410,准备工作

1.首先是获得linux内核源码,好像是废话,下载地址如下:ftp://ftp.kernel.org/pub/linux/kernel/v2.6/下载:
linux-2.6.16.22.tar.bz2  patch-2.6.22.6.bz2
上面一步需要说明的是一般而言,linux内核的各个补丁文件是根据某个linux内核的版本号来作的patch。
将上面的两个压缩文件解压:
tar jxvf linux-2.6.22.ta ......

c sharp 命令行的用法

使用 C# 2.0 命令行编译器
http://msdn.microsoft.com/zh-cn/library/ms379563(vs.80).aspx#mainSection
摘要:本文分析了使用 C# 命令行编译器 csc.exe 生成应用程序的过程。同时,还将向读者介绍很多为 C# 2.0 独有的编译器选项,例如,extended/reference 标志和强名称支持。阅读完本文的内容之后,您将能够轻松地在没 ......

C程序中main参数argv和argc

      命令行界面的程序,通常都需要输入命令行参数帮助程序执行。main是最典型的此类应用,main的参数之前都被忽略掉了。
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
   int count;
   printf("The command line has %d arguments:\n", ......

清理C盘大攻略——立即见效


1.打开“我的电脑”-“工具”-“文件夹选项”-“查看”-在“显示所有文件和文件夹”选项前打勾-“确定” 
2.删除以下文件夹中的内容: 
x:\\Documents and Settings\\用户名\\Cookies\\下的所有文件(保留index文件) 
x:\\Documents and S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号