
c语言
m_bkj
这个作者很懒,什么都没留下…
展开
-
文章标题
pointers.c的代码以及实现功能如下:#include<stdio.h>#include<stdlib.h>void f(void) { int a[4]; int*b = new int[16];//(int*)malloc(16);//分配长度为16bytes字节的内存块 int*c=0;int i; printf("1:a=%p,b=%p,c=%p\n转载 2015-11-22 00:03:38 · 313 阅读 · 0 评论 -
fprintf() stderr std out stdin
定义 int fprintf (FILE* stream, const char*format, [argument]) FILE*stream:文件指针 const char* format:输出格式 [argument]:附加参数列表 功 能 传送格式化输出到一个文件中与打印机输出 用 法#include <stdio.h>#include<stdlib.h>int fprin转载 2015-12-22 12:14:56 · 1530 阅读 · 1 评论 -
crt安全警告问题
#ifdef _MSC_VER/* * we do not want the warnings about the old deprecated and unsecure CRT functions * since these examples can be compiled under *nix as well */#define _CRT_SECURE_NO_WARNINGS#end转载 2015-12-22 20:22:34 · 789 阅读 · 0 评论 -
strdup()
头文件: #include<string.h>定义函数:char * strdup(const char *s);函数说明:strdup()会先用maolloc()配置与参数s 字符串相同的空间大小,然后将参数s 字符串的内容复制到该内存地址,然后把该地址返回。strdup()在内部调用了malloc()为变量分配内存,不需要使用返回的字符串时,需要用free()释放相应的内存空间,否则会造成转载 2015-12-21 20:10:02 · 414 阅读 · 0 评论 -
pcap_open()(网上资料)
我们主要使用的函数是pcap_open(),这个函数的功能是打开一个抓取设备。pcap_t *pcap_open(const char * source,int snaplen,int flags,int read_timeo转载 2015-12-22 20:48:50 · 4975 阅读 · 0 评论 -
WinPcap Pcap_findalldevs_ex() pcap_if
本课用到的数据结构简介: ①pcap_if 结构: ⑴typedef struct pcap_if pcap_if_t cap_if在incs/pcap.h文件的72行有定义 ⑵pcap_if结构里面的数据域:struct pcap_if{ pcap_if * next; //指向下一个元素的指针;如果是NULL,表示链表结束。 char * name ;//一个指向字符串的转载 2015-12-22 12:46:39 · 5258 阅读 · 0 评论