c的结构在c#里的定义方法
2013-06-05 13:38
211 查看
typedef struct{ songinfo songs[5]; int foundnum; }QUERYRESULT; typedef struct{ int id; int hits; char name[80]; float spos[5]; int sposnum; }songinfo;
c#
[StructLayout(LayoutKind.Sequential, Pack = 1)] public struct QueryResult { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public SongInfo[] songs;//检索到的音频信息列表 public int foundnum; //检索到的音频数量 } [StructLayout(LayoutKind.Sequential, Pack = 1)] public struct SongInfo { public int id; //该音频文件对应的id号 public int hits; //待检索音频与该音频对应的冲撞值 [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string name; //音频对应的文件名 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public float[] spos;//待检索音频数据在该音频中的起始时间 public int sposnum; //待检索音频数据在音频中的位置数量 }
相关文章推荐
- C#中的自定义结构转换操作符的定义方法
- C#编程:枚举(enum)与结构(struct)的定义和使用方法
- C#调用VC DLL 复杂结构 解决方法
- C#中将结构类型数据存储到二进制文件中方法
- C# 将扁平状数据链接成树状结构的通用方法
- 结构体定义 方法
- c#工程中全局变量的定义方法
- Atitit. 构造ast 语法树的总结attilax oao 1. Ast结构树形12. ast view (自是个160k的jar )22.1. 多条语句ast结构22.2. 变量定义 int b,c; 的ast结构22.3. 方法调用meth1(a=1,b=2,c=3); 的ast结构23. 误解的问题33.1. 语法书子能是个二叉树,实际上多叉树越好..33.2. 非要不个ast放到个s
- C#编程(三十)----------泛型结构,泛型方法,泛型委托
- 17、C#中的常量和结构的定义与使用
- C# DateTime结构的常用方法
- C#中比较常用的DateTime结构的使用方法
- C#定义泛型方法错误-类型“T”必须是引用类型才能用作泛型类型或方法“System.Data.Linq.Table<TEntity>”中的参数“TEntity”
- 【C#】delegate委托的定义和使用方法
- C#温故而知新学习系列之面向对象编程—定义结构(二)
- C#动态生成按钮及定义按钮事件的方法
- C#中将结构类型数据存储到二进制文件中方法
- C# 定义常量的两种方法(转载)
- 这篇文章主要介绍了C#中的匿名方法,包括其由来、定义及用法等,需要的朋友可以参考下