convert int to char
int a = 125; int b[50]; sprintf (b‚ "%d"‚ a); /* b contient la chaine "125"‚ et on concactene "oui". */ strcat (b‚ "oui"); printf ("%s\n"‚ b); ATTENTION : the first parameter of the fonction sprintf should be char[]
Creation and use the DLL in Visual Studio
We will, in the article, see some examples for creating and using the DLL in VS. What's DLL? Dynamic-link library , or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries...
Using C++ library in C code
extern “C” can help you to call c fonction from c++, and also it can help you do the reverse. But as we know c++ has class which we cannot use in c, so we have to do some wrapper to help us. 1. //code in add.cxx 2. #include "add.h" 3. int sample::method()...
C/C++中static关键字详解
http://www.cnblogs.com/yc_sunniwell/archive/2010/07/14/1777441.html 静态变量作用范围在一个文件内,程序开始时分配空间,结束时释放空间,默认初始化为0,使用时可以改变其值。 静态变量或静态函数只有本文件内的代码才能访问它,它的名字在其它文件中不可见。 用法1:函数内部声明的static变量,可作为对象间的一种通信机制 如果一局部变量被声明为static,那么将只有唯一的一个静态分配的对象,它被用于在该函数的所有调用中表示这个变量。这个对象将只在执行线程第一次到达它的定义使初始化。...