sizeof 深入理解

sizeof 深入理解

sizeof你们觉得是什么呢。函数?其实是操作符。
wiki解释

In the programming languages C and C++, the unary operator ‘sizeof’ is used to calculate the sizes of datatypes, in number of bytes. sizeof can be applied to all datatypes, be they primitive types such as the integer and floating-point types defined in the language, pointers to memory addresses, or the compound datatypes (unions, structs, or C++ classes) defined by the programmer. sizeof is an operator that returns the size in bytes of the type of the variable or parenthesized type-specifier that it precedes as a size_t type value.

sizeof is an operator:sizeof是一个操作符。擦 这货居然是操作符。
最后一句我们可以得到的信息还有sizeof操作符的结果类型是size_t,它在头文件中typedef为unsigned int类型。该类型保证能容纳实现所建立的最大对象的字节大小。

Read more

为什么要有自己的一个博客

缘起

想有自己建站的blog是一直没有实现的一件事情。陆陆续续用51cto、is-programmer、renren等写过blog或者类似blog的东西。但是觉得还是缺少一些什么东西。后面慢慢的明白了,我虽然是号称学IT技术的。其实我根本就落后时代了。Web是什么我都不懂。适合学IT的人都有自己搭建的技术blog,技术人有自己的一个站好像是一个很容易的事情。可是我就是弄不起来,觉得写Web是一个洪水猛兽般的事情。一直觉得用现成的就好。可是用着又觉得自己不专业。然后就开始寻觅着是不是自己搭建一个Blog。然后先买了域名。就开始吭哧吭哧的学Web开发。Java是放弃了的,然后看Python、看Ruby。后面发现一个问题,就是我现在太苦逼了——工资刚刚能活,买不起VPS。不管是django还是rails我都搭建不起服务器来。再说我也只是知道他们的名字而已。具体怎么写一个blog居然一点头绪都没有。html,css,javascript这些高端的东西更是不会。自己建blog站,觉得离我越来越遥远了。

Read more