02 2016 档案

关于vector.size()和string.length() 的返回类型 size_type
摘要:今天写循环的时候碰到一个问题,发现:string.length()返回的类型是size_type。它是unsigned 类型。string::size_type它在不同的机器上,长度是可以不同的,并非固定的长度。但只要你使用了这个类型,就使得你的程序适合这个机器。与实际机器匹配。 如果你的机器是32 阅读全文

posted @ 2016-02-24 23:09 暴力的轮胎 阅读(1872) 评论(0) 推荐(0)

内存地址对其方式
摘要:面试的时候遇到了这样一个关于结构体大小的问题。今天突然想了想。 struct node{ int r;//4 byte char t1[2]; //sizeof node = 14 // char t1[3]; sizeof(node) = 20 char t2[10];//10 byte }; 这 阅读全文

posted @ 2016-02-23 10:31 暴力的轮胎 阅读(186) 评论(0) 推荐(0)

leetcode143. Reorder List
摘要:Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文

posted @ 2016-02-23 02:55 暴力的轮胎 阅读(837) 评论(0) 推荐(0)

导航