
c 语言程序设计
tsh185
这个作者很懒,什么都没留下…
展开
-
printf 十六进制格式化输出 2字节对齐
每次看到人家的十六进制输出,对齐的很好,ff就显示了,而我的总是0xffffffff。如果是"%02x",是以0补齐2位数,如果超过2位就显示实际的数;"%hhx" 是只输出2位数,即便超了,也只显示低两位; 因此有了"%02hhx"http://blog.chinaunix.net/uid-20801390-id-3207987.htm转载 2013-10-17 11:12:26 · 1206 阅读 · 1 评论 -
A-Z 大小写转换
a-z 转换为大写 'a' - 32 == 'A'A-Z 转换为小写 'A'|32 == 'a'原创 2013-05-24 14:27:47 · 1608 阅读 · 0 评论 -
笔试遇到的两个问题 (c、c++)
// 题目1 根据程序写结果 #include #include using namespace std; class A{ public: A() { m_static++ ; } int getAValue() {原创 2010-03-23 22:41:00 · 437 阅读 · 0 评论 -
c/c++ 求解 (问题求解)
#include #include using namespace std; int main(int argc, char *argv[]){ char *a = new char[15]; int *b = new int [15]; strcpy(a,"This is test/0") ; for(int i =0 ; i {原创 2009-08-02 10:50:00 · 595 阅读 · 1 评论 -
求解(一)c / c++
#include "iostream"#include "cstdlib" using namespace std ; void GetMemory(char *P){ P = new char[12]; //这两句有什么不同没?? //p=(char*)malloc(12*sizeof(char));}in原创 2009-08-02 10:32:00 · 405 阅读 · 1 评论 -
FFI Library (lua 调用 c)
http://luajit.org/ext_ffi.htmlThe FFI library allows calling external C functions and using C data structuresfrom pure Lua code.The FFI library largely obviates the need to write tedio原创 2016-04-07 11:28:04 · 3455 阅读 · 0 评论