易截截图软件、单文件、免安装、纯绿色、仅160KB

linux控制台显示中文

#include <stdio.h>
#include <wchar.h>
#include <locale.h>
int main()
{
#ifdef _WIN32
  setlocale(LC_ALL, "chs");
#else
  setlocale(LC_ALL, "zh_CN.UTF-8");
#endif
  wchar_t KZg[] = {0x6211, 0};
  char buf[10] = {0};
  wcstombs(buf,KZg,10);
  printf("_%s_\n",buf);
}
wchar_t 在linux上是4个字节, 在win32上是2个字节, MinGW也是2个字节.
一般会节省空间使用utf-16.
#ifdef _WIN32
  typedef wchar_t uchar;
#else
  typedef unsigned short uchar; // 就不能使用string.h提供的宽字符串方法了.
#endif
linux上使用string常量只能用{}.


相关文档:

实战Linux Bluetooth编程(六) L2CAP编程实例

例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
 如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......

linux内核空间申请超过2MB连续空间的实现函数。

 /*
kmalloc can apply 128KB memory only. This func support any continous memory allocate more than 2MB.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#define KMEM_PAGES       &nb ......

linux下必须掌握的命令

1 cron
 
以下,是ctontab的格式:
分<>时<>日<>月<>星期<>要运行的命令
其中<>表示空格。
这里有c r o n t a b文件条目的一些例子:
30 21* * * /apps/bin/cleanup.sh
上面的例子表示每晚的2 1 : 3 0运行/ a p p s / b i n目录下的c l e a n u p . s h。
45 4 1,10,22 * ......

linux学习笔记

点击菜单“虚拟机”--Install VMware Tools
在red hat桌面右击konsole
输入命令:cd/media
          ls
          要先双击VMware Tools再输入命令直到出现VMware Toolsi
再输入命令:cd VM*
  &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号