
面试准备
文章平均质量分 77
linuxlinuxlinuxlinux
这个作者很懒,什么都没留下…
展开
-
面试准备(语法)sizeo f和 sizeof(string)的问题
1、什么是sizeof 首先看一下sizeof在msdn上的定义: The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type (including aggregate types). This keyword returns a value转载 2013-07-27 21:27:34 · 932 阅读 · 0 评论 -
面试准备(常用函数和数据结构)C++Vector用法
C++内置的数组支持容器的机制,但是它不支持容器抽象的语义。要解决此问题我们自己实现这样的类。在标准C++中,用容器向量(vector)实现。容器向量也是一个类模板。标准库vector类型使用需要的头文件:#include 。vector 是一个类模板。不是一种数据类型,vector是一种数据类型。Vector的存储空间是连续的,list不是连续存储的。一、 定义和初始化vecto转载 2013-07-26 15:28:10 · 902 阅读 · 0 评论 -
面试准备(常用函数和数据结构)freopen (在程序调试时从文本输入,程序结果放在文本中)
1、int putc(int ch, FILE *stream); 输出一字符到指定流中int main(void){ char msg[] = "Helloworld\n"; int i = 0; while (msg[i]) putc(msg[i++], stdout); return 0;} 2、int putchar(int ch);转载 2013-07-26 10:00:03 · 978 阅读 · 0 评论 -
面试准备(语法类)(int&)a和(int)a的区别
#include #include #include using namespace std;int main(){ float a = 1.0f; cout << (int)a << endl; cout << (int&)a << endl; cout << boolalpha << ( (int)a == (int&)a ) << endl; // 输出什么? float转载 2013-07-26 14:47:12 · 747 阅读 · 0 评论 -
面试准备(字符串类)写一个函数,完成内存之间的拷贝(考虑全面)
// 功能:由src所指内存区域复制count个字节到dest所指内存区域。// 说明:src和dest所指内存区域可以重叠,但复制后dest内容会被更改。函数返回指向dest的指针void *memmove(void *dest , const void *src , size_t count){ assert( (dest != NULL) && (src != NULL));转载 2013-07-26 17:28:16 · 3634 阅读 · 0 评论