易截截图软件、单文件、免安装、纯绿色、仅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编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

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 系统时间设置、编程总结

未完待续...
设置时间:
date -s "2009/11/08 11:23:00"
硬件时钟与系统时间同步一下:
hwclock --systohc
编程:
#include <cstdlib>
time_t time(time_t *timer)
调用后将当前系统时间与1900年1月1日相差的秒数存入到timer中,timer可看成是一个长整型数
具体描述:
  函数原型:  ......

关于linux下的软链接和硬链接

 连接上了服务器,检查一下。磁盘空间不够了
[java@localhost ~]$ df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 5.8G 5.8G 0M 100% /
/dev/hda1 99M 8.5M 86M 10% /boot
none 506M 0 506M 0% /dev/shm
/dev/hda6 20G 77M 19G 1% /tmp
/dev/hda5 20G 14G 5.2G 72% /usr/local
/dev/hd ......

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号