arm-linux

http://armboard.taobao.com/

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2010年5月25日

摘要: int snprintf(char *restrict buf, size_t n, const char * restrict format, ...);函数说明:最多从源串中拷贝n-1个字符到目标串中,然后再在后面加一个0。所以如果目标串的大小为n 的话,将不会溢出。函数返回值:若成功则返回欲写入的字符串长度,若出错则返回负值。Result1(推荐的用法)#include <stdio.h>#include <stdlib.h>int main(){ char str[10]={0,}; snprintf(str, sizeof(str), "012345 阅读全文
posted @ 2010-05-25 16:59 arm-linux 阅读(55141) 评论(0) 推荐(0) 编辑

摘要: 一.文件目录结构如下图:二.视频设备自定义的数据结构------------------------------------------struct vdIn { int fd; char *videodevice ; //视频设备文件路径,如/dev/video0 struct video_mmap vmmap;//内存映射 struct video_capability videocap; int mmapsize; struct video_mbuf videombuf; struct video_picture videopict; struct video_window videow 阅读全文
posted @ 2010-05-25 16:56 arm-linux 阅读(492) 评论(0) 推荐(0) 编辑