随笔分类 -  最C/C++

1 2 下一页

小议函数指针
摘要:void f1(int *pi){ int *a = pi;}void f2(double *pd){ int *a = (int *)pd; *a = 2000;}class B{public: B():member(-1){} int member; int fu... 阅读全文

posted @ 2014-06-18 23:42 silyvin 阅读(157) 评论(0) 推荐(0) 编辑

vector的push_back对于拷贝构造和赋值操作的调用
摘要:http://blog.csdn.net/silyvin/article/details/8985323对应与CArray,补充一个vector的测试。class A{ int *m_a; int bb;private: A();public: A(int n) { ... 阅读全文

posted @ 2014-06-08 09:43 silyvin 阅读(449) 评论(0) 推荐(0) 编辑

一个指针的引用引发的血案
摘要:tes *ptes;tes *&gfunc(){return ptes;}以上是全局指针 tes *ptemp = gfunc();delete ptemp;ptemp = new tes;这里犯了个错误,以后再次调用 gfunc访问ptes 时,东西已经清理掉了,程... 阅读全文

posted @ 2014-05-29 23:06 silyvin 阅读(124) 评论(0) 推荐(0) 编辑

CLAPACK动态调用
摘要:http://blog.csdn.net/silyvin/article/details/9104463在VS中用CLAPACK解决广义特征值问题中介绍了CLAPACK静态链接库,供C++调用,这里再介绍以DLL形式完成调用的方式。打开解决方案,在项目lapack中寻... 阅读全文

posted @ 2014-04-17 23:40 silyvin 阅读(293) 评论(0) 推荐(0) 编辑

阶乘、阶乘之和的函数式风格实现
摘要:#include template class Factorial{public: static int const vl = N * Factorial::vl;};template class Factorial{public: static int const ... 阅读全文

posted @ 2013-10-11 22:12 silyvin 阅读(141) 评论(0) 推荐(0) 编辑

DLL 导出类
摘要:http://www.cnblogs.com/cswuyg/archive/2011/10/06/DLL2.html编写DLL所学所思(2)——导出类http://www.cppblog.com/suiaiguo/archive/2009/07/20/90663.ht... 阅读全文

posted @ 2013-08-14 17:15 silyvin 阅读(89) 评论(0) 推荐(0) 编辑

如何在AutoCAD中实现鼠标双击事件
摘要:摘要:本文为在AutoCAD ObjectARX二次开发中遇到的鼠标双击事件提供了多种解决方法。在AutoCAD编程中,开发者可能会有这样一个好想法,或者用户有这么一个需求:当用鼠标双击某个实体的时候,弹出一个窗体,显示实体的属性,比如说,一所学校的名称、座落等信息。... 阅读全文

posted @ 2013-07-08 16:27 silyvin 阅读(874) 评论(0) 推荐(0) 编辑

在VS中用CLAPACK解决广义特征值问题
摘要:CLAPACK是LAPACK的C语言接口。LAPACK的全称是Linear Algebra PACKage,是非常著名的线性代数库。LAPACK是用Fortran写的,为了方便C/C++程序的使用,就有了LAPACK的C接口库CLAPACK。现在通过使用CLAPACK... 阅读全文

posted @ 2013-06-16 01:26 silyvin 阅读(602) 评论(0) 推荐(0) 编辑

再议:__cdecl与__stdcall 调用约定在动态链接库调用中不同的表现
摘要:dll中函数声明 dll中函数名 void __declspec(dllexport) add(int, int)?add@@YAXHH@Z extern "C" void __declspec(... 阅读全文

posted @ 2013-05-28 15:52 silyvin 阅读(195) 评论(0) 推荐(0) 编辑

CArray 的两种方式与类中包含指针情况
摘要:参考:http://bbs.csdn.net/topics/390452085项目很复杂,我简化了下代码考虑一个类进 CArray class A{ int *m_a;public: A()//不带参数构造函数,只是为了通过编译 { int fenge = 4; }... 阅读全文

posted @ 2013-05-28 08:40 silyvin 阅读(241) 评论(0) 推荐(0) 编辑

函数传值 复制构造函数 深度拷贝
摘要:class A{ int *m_pi;public: A() { m_pi = new int; } ~A() { delete m_pi; }};void func(A _a){ int a = 0;}void main(){ A a; func(a);}运行... 阅读全文

posted @ 2013-05-07 21:51 silyvin 阅读(121) 评论(0) 推荐(0) 编辑

C++ 中dynamic_cast的使用方法
摘要:/*这是从网上摘下的例子,主要讲述了 dynamic_cast 的使用方法。*/ /* 作用:将一个基类对象指针(或引用)cast到继承类指针,dynamic_cast会根据基类指针是否真正指向继承类指针来做相应处理, 即会作一定的判断。 ... 阅读全文

posted @ 2013-05-06 16:16 silyvin 阅读(151) 评论(0) 推荐(0) 编辑

类成员析构、虚析构函数、动态生成对象相关的 关于析构顺序的杂谈
摘要:#include class A{public: A(){cout class A{public: A(){cout class A { public: A(){cout class A { public: A(){co... 阅读全文

posted @ 2013-05-01 08:51 silyvin 阅读(138) 评论(0) 推荐(0) 编辑

vector 的读写
摘要:void CPreData::ReadDataWarehouse(){ UINT nVectorSize = 0; HANDLE hFile = CreateFile(m_szDataWarehouse, FILE_READ_DATA, FILE_SHARE_READ... 阅读全文

posted @ 2012-12-18 15:06 silyvin 阅读(336) 评论(0) 推荐(0) 编辑

c 复制二进制流
摘要:参考 feof与EOF feof()和EOF用法fp=fopen("0.exe","rb"); 注意 ‘b'gp=fopen("1.exe","wb"); 将fp的文件指针移至末尾用fseek然后使用ftell(fp)求出文件指针的便宜,实际上就是文件的大小... 阅读全文

posted @ 2012-12-13 09:13 silyvin 阅读(160) 评论(0) 推荐(0) 编辑

重定向输出遇到的缓冲问题
摘要:一个项目中需要迭代计算,时间长,但是在重定向输出的时候所有标准输出不能及时输出,这就要求程序主函数正常运行完后才能正常输出到文件。因为标准输出到终端时默认行缓冲或无缓冲,重定向到硬盘之后,就变成了全缓冲1. Fully buffered means that I/O ... 阅读全文

posted @ 2012-12-11 11:33 silyvin 阅读(166) 评论(0) 推荐(0) 编辑

fopen 中 按文本读写与按二进制读写 实例
摘要:参考:http://blog.csdn.net/hinyunsin/article/details/6401854#include int main(int argc, char *argv[]){ char he[20] = "hello world\n"; FI... 阅读全文

posted @ 2012-12-10 10:21 silyvin 阅读(832) 评论(0) 推荐(0) 编辑

解决头文件相互包含问题的方法
摘要:所谓超前引用是指一个类型在定义之前就被用来定义变量和声明函数。 一般情况下,C/C++要求所有的类型必须在使用前被定义,但是在一些特殊情况下,这种要求无法满足,例如,在类CMyView中保留了一个非模式对话框对象指针,该对象用于显示/修改一些信息。为了实现对话框... 阅读全文

posted @ 2012-05-17 13:13 silyvin 阅读(152) 评论(0) 推荐(0) 编辑

__cdecl与__stdcall 调用约定在动态链接库调用中不同的表现
摘要:首先建立__cdecl 调用约定函数的动态链接库。FirstDll.cpp#include BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,... 阅读全文

posted @ 2012-04-06 19:36 silyvin 阅读(369) 评论(0) 推荐(0) 编辑

C 运行时库版本
摘要:http://msdn.microsoft.com/en-us/library/Aa984820The following table lists the release versions of the C run-time library files, along ... 阅读全文

posted @ 2012-04-06 14:36 silyvin 阅读(205) 评论(0) 推荐(0) 编辑

1 2 下一页
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示