http://blog.csdn.net/daiyutage/article/details/8575248 在C语言中, signed char 类型的范围为-128~127,每本教科书上也这么写,但是没有哪一本书上(包括老师)也不会给你为什么是-128~127,这个问题貌似看起来也很简单容易, ...
分类:
其他好文 时间:
2014-06-25 12:02:54
阅读次数:
164
1.打开数据库 int sqlite3_open( const char *filename, // 数据库的文件路径 sqlite3 **ppDb // 数据库实例 );2.执行任何SQL语句 int sqlite3_exec( sqlite3*, ...
分类:
数据库 时间:
2014-06-25 11:57:30
阅读次数:
263
Java中的基本数据类型分四类八种byte(Byte-1)/short(Short-2)/int(Integer-4)/long(Long-8)boolean(Boolean-1bit)char(Character-2)float(Float-4)/double(Double-8)括号后是他们的包装...
分类:
编程语言 时间:
2014-06-25 11:31:46
阅读次数:
234
1 const 传达的意思应该是这个变量是常量不能更改2 const 在 * 左边表示数据是const,在右边表示指针是const // char greeting[] = "hello"; char* p = greeting; //const *: const data //...
分类:
编程语言 时间:
2014-06-25 11:12:18
阅读次数:
229
char * 类型转换为wxString类型,int类型转换为为wxString类型...
分类:
其他好文 时间:
2014-06-25 08:21:37
阅读次数:
159
#include
#include
using namespace std;
int main(int agrc, char *agrv[])
{
int iInPut = 0;
while (cin >> iInPut)
{
string sBinary;//转换后的二进制存储为字符串,调用了默认构造函数初试化为空串
int temp = abs(iInPut);
if (t...
分类:
其他好文 时间:
2014-06-25 07:42:13
阅读次数:
280
attribute method:
#include
struct packed
{
char a;
int b;
} __attribute__((packed));
struct not_packed
{
char a;
int b;
};
int main(void)
{
printf("Packed: %zu\n", sizeof(...
分类:
其他好文 时间:
2014-06-25 07:29:49
阅读次数:
155
昨天看到strcpy函数的典型实现时,发现该函数的返回值为局部指针变量,当时产生疑问:局部指针在函数结束时不是会被注销掉吗?为什么此处没有呢?
下面给出strcpy函数代码:
char* Mystrcpy(char* strDest, const char* strSrc)
{
assert((strDest!= NULL)&&(strSrc != NULL));
char* adress...
分类:
其他好文 时间:
2014-06-25 07:18:50
阅读次数:
184
每一个iPhone程序都包含一个UIApplication对象,它管理整个程序的生命周期,从加载第一个显示界面开始,并且监听系统事件、程序事件调度整个程序的执行。
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int ret...
分类:
移动开发 时间:
2014-06-25 06:55:38
阅读次数:
268
??
通常情况下,旧的C API使用数组合char*指针来进行数据交换而不是vector或string对象。这样的API还将存在很长的一段时间,如果我们想有效地使用STL,我们就必须与它们和平共处。
幸运的是,这很容易做到。如果有一个vector v,而需要得到一个指向v中数据的指针,从而可把v中的数据作为数组来对待,那么只需要使用&v[0]就可以了。对于string
s,对应的形...