码迷,mamicode.com
首页 >  
搜索关键字:sizeof    ( 5917个结果
源码测试
1 // typesize.c -- 输出类型的大小 2 #include 3 int main(void) 4 { 5 //C99为类型大小提供一个%zd说明符 6 7 printf("Type int has a size of %u bytes. \n", sizeof(...
分类:其他好文   时间:2014-06-28 23:13:47    阅读次数:245
剑指OFFER之第一个只出现一次的字符(九度OJ1283)
题目描述:在一个字符串(1#include int main(){ int i; char c[10000]; int cnt[24]; while(scanf("%s",&c)!=EOF){ memset(&cnt,0,sizeof(int)*24); ...
分类:其他好文   时间:2014-06-28 12:31:02    阅读次数:231
简单实现内存池
#include "common.h"#include "pool.h"#include static inline void *objmem_to_obj(void *objmem){return objmem + sizeof(pool_obj_head_t);}static inline vo...
分类:其他好文   时间:2014-06-27 21:24:59    阅读次数:292
读贾志鹏《线性筛法与积性函数》笔记
1.欧拉筛法在线性时间内求素数以及欧拉函数代码: 1 procedure get; 2 var i,j,k:longint; 3 begin 4 tot:=0; 5 fillchar(check,sizeof(check),false); 6 for i:=2 to n do 7 be...
分类:其他好文   时间:2014-06-25 22:11:51    阅读次数:574
No Memory Alignment with GCC
attribute method: #include struct packed { char a; int b; } __attribute__((packed)); struct not_packed { char a; int b; }; int main(void) { printf("Packed: %zu\n", sizeof(...
分类:其他好文   时间:2014-06-25 07:29:49    阅读次数:155
sizeof与strlen的区别
非常详细的strlen与sizeof区别详解...
分类:其他好文   时间:2014-06-24 17:51:34    阅读次数:146
*(char **) != char*
char *myCharacters[3] = { "TomJohn", "George", "Charles Condomine" }; qsort_b(myCharacters, 3, sizeof(char *), ^(const void *l, const void *r) { ...
分类:其他好文   时间:2014-06-24 15:06:37    阅读次数:172
无需考虑编码问题string转byte的方法
static byte[] GetBytes(string str){ byte[] bytes = new byte[str.Length * sizeof(char)]; System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, ...
分类:其他好文   时间:2014-06-24 14:15:24    阅读次数:145
wav转aac
//调用neroAacEnc.exe STARTUPINFO si={0}; PROCESS_INFORMATION pi={0};//隐藏窗口 si.cb=sizeof(si); si.dwFlags= STARTF_USESHOWWINDOW| STARTF_USESTDHANDLES;...
分类:其他好文   时间:2014-06-20 21:29:11    阅读次数:268
Tips for C
1. sizeof(literal-string) is number of bytes plus 1 (NULL is included), while strlen(literal-string) is number of bytes.2. Printf and scanf formatBefo...
分类:其他好文   时间:2014-06-18 10:14:22    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!