随笔分类 -  C++

C++知识学习
摘要:1、没有显式初始化数组,则:在函数体外定义的内置数组,其元素均会初始化为0;在函数体内定义的内置数组,其元素均无初始化;无论数组在哪里定义,如果元素为类类型,则自动调用该类的默认构造函数进行初始化;如果该类没有默认构造函数,则必须为该数组的元素提供显式初始化。2、数组安全性最大的问题是缓冲区溢出(b... 阅读全文
posted @ 2014-04-10 19:24 super 86 阅读(187) 评论(0) 推荐(0)
摘要:Vectors are sequence containers representing arrays that can change in size.Just like arrays, vectors use contiguous storage locations for their elements, which means that their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in arrays. But 阅读全文
posted @ 2014-03-25 14:32 super 86 阅读(532) 评论(0) 推荐(0)