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

在c中如何实现继承的效果

http://topic.csdn.net/u/20100413/09/ffc0fcd5-c3c1-4a15-b5a2-f1bf65f50caa.html?21874
C/C++ code
typedef struct _VSCSIDISK_COMMON_DEVICE_EXTENSION
{
BOOLEAN IsPdo;
} VSCSIDISK_COMMON_DEVICE_EXTENSION, *PVSCSIDISK_COMMON_DEVICE_EXTENSION;

typedef struct _VSCSIDISK_PDO_DEVICE_EXTENSION
#ifdef __cplusplus
: VSCSIDISK_COMMON_DEVICE_EXTENSION
{
#else
{
VSCSIDISK_COMMON_DEVICE_EXTENSION;//这里怎样理解?
#endif
ULONG DeviceId; // unique device id
} VSCSIDISK_PDO_DEVICE_EXTENSION, *PVSCSIDISK_PDO_DEVICE_EXTENSION;
正确解释 16楼
因为C语言没有类及继承的概念,所以不能给结构指定基类。“VSCSIDISK_COMMON_DEVICE_EXTENSION;”就是实现继承的效果,不指定成员变量名,则可以直接访问VSCSIDISK_COMMON_DEVICE_EXTENSION中的成员,例如:
VSCSIDISK_PDO_DEVICE_EXTENSION x;
x.IsPdo = FALSE;
如果指定了成员变量名,则要用变量名来访问,假设定义为“VSCSIDISK_COMMON_DEVICE_EXTENSION a;”,则访问方式为:
VSCSIDISK_PDO_DEVICE_EXTENSION x;
x.a.IsPdo = FALSE;


相关文档:

C的enum struct 以及 Java的enum

 在c中enum的使用和struct很像
enum name{
a,b,c
};

 
struct name{
int a;
int b;
char c;
};

 
or
 
typedef struct{
int a;
int b;
char c;
}Name;

使用的时候都要先声明变量
 
enum name n1,n2,n3;
n1=a;
n2=b;
n3=enum name(3-1);
struct name sn1,sn2;
s ......

My emacs color theme for c and c++

在这儿下载:color-theme
:
http://download.savannah.gnu.org/releases-noredirect/color-theme/
wget http://download.savannah.gnu.org/releases-noredirect/color-theme/color-theme-6.6.0.tar.gz
tar zxf color-theme-6.6.0.tar.gz -C ~/.emacs.d
在.emacs中加入下列语句:
;; corlor-theme ......

entry point to c/c++ or Fortran MEX file

http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexfunction.html
mexFunction (C and Fortran) -
Entry point to C/C++ or Fortran MEX-file
C Syntax
#include "mex.h"
void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
const mxArray *prhs[]);
Fortran
Syntax
subrouti ......

Java与C通信要注意的几个问题

1.大尾(big_endian)小尾(little_endian)的问题
基于Web的测试软件是由C++数据采集服务器程序和客户端Java显示程序两部分构成,前者用C++,后者Java语言,存在数据移植问题。因为
在计算机系统中,当包含数字的二进制文件从一个结构移到另一结构时,就出现大尾小尾问题。不同CPU在多字节数(如四字节int)存储时有两种方法 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号