![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
嵌入式面试
gorunbu
很烦。。。。。。。。。。。。。。。
展开
-
extern 用法:
extern 用法: 1.readme:extern 表明是“外部的” 与 static 相反,需要引用另一个文件中定义的 variable or function , 需要在调用之前 extern 声明它的存在。 一般都是在.h文件中声明。 2.注意: 在.h 文件中 variable 需要添加 extern,function 可以添加,也可以不添加 e原创 2015-03-29 16:58:21 · 511 阅读 · 0 评论 -
嵌入式面试题(转)
(1)什么是预编译,何时需要预编译: 答案: 1、总是使用不经常改动的大型代码体。 2、程序由多个模块组成,所有模块都使用一组标准的包含文件和相同的编译选项。在这种情况下,可以将所有包含文件预编译为一个预编译头。 (2)char * const p char const *p const char *p上述三个有什么区别? 答案: char * const p; //常量指针,p转载 2015-03-29 17:19:15 · 482 阅读 · 0 评论 -
嵌入式面试题总结【static,const。lvalue and 如rvalue】 继续整理
static 用法: for C language: 1.表示存储属性: 存储于静态变量区,static int a; 由于存储于静态变量区,导致变量的记忆性[不会由于栈的回收而丢失],int fun(){ static int a;…} 2.链接属性 说明变量或者函数内部链接的,只在本文件有效,及时在另外一个文件e原创 2015-03-29 09:17:39 · 608 阅读 · 0 评论 -
const用法(转)
/-----以下引用自网络--------- 1.常量不能为左值cannot convert 'this' pointer from 'const class X' to 'class X &' 例子: #include <iostream.h> class X { int i; public: void modify() {cout<<"haha"<<endl;} }; co转载 2015-03-29 09:53:31 · 472 阅读 · 0 评论 -
static 与 内存(转)
---------以下引用网络,static 用法------------------------------ static关键字的作用 最近经历了一些笔试和面试,经常会被问到static关键字的作用,感觉虽然知道一些,但每次回答的都不够满意,今天在网上查了一下,总结总结,恩,以备后用!综述 static关键字是C, C++中都存在的关键字。static从字面理解,是“静态的“的 意思,与 此相对应转载 2015-03-29 10:29:34 · 561 阅读 · 0 评论 -
volatile
volatile: 1.readme:修饰符[表示易变的],对于关键字修饰的变量,编译器对访问该变量的代码就不再进行优化[由于可能会被意想不到地改变,OS,多线程,硬件中断等], 从而可以提供对特殊地址的稳定访问。 精确地说就是,优化器在用到这个变量时必须每次都小心地重新读取这 2.编译器优化【为了提高效率】: int a = 2; int b = a;原创 2015-03-29 10:26:44 · 371 阅读 · 0 评论 -
the classical examination test
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> //copy the ”n-m“ size string from point m void StrMid(char* str1,int m,int n,char* str2) { if( !str1 && !str2){原创 2015-07-12 21:11:33 · 349 阅读 · 0 评论 -
static trap
#include <stdio.h>#include <iostream>#include <unistd.h>using std::cout; using std::endl;void print(char* str1,char* str=NULL) { cout<<"str= "<<str<<endl; //printf("\n"); printf("str: %p\n"原创 2015-07-17 16:50:24 · 449 阅读 · 0 评论 -
嵌入式面试题总结
static 用法: for C language: 1.表示存储属性: 存储于静态变量区,static int a; 由于存储于静态变量区,导致变量的记忆性[不会由于栈的回收而丢失],int fun(){ static int a;...} 2.链接属性 说明变量或者函数内部链接的,只在本文件有效,及时在另外一个文件extern引用也不可以。 int the file1: sta原创 2015-03-26 21:03:13 · 201 阅读 · 0 评论