国内某机器视觉公司笔试基础试题回忆:
5. window编程的考察
1.全局与局部变量的作用域考察
int i = 16;
{
int i = 1;
cout<<i<<endl;
}
cout<<i <<endl;
写出两个i的值,具体可能还要复杂一些。
2. 假设操作系统为32位,则
int i = 16;
char a = 'a';
char *b = (char *)malloc(100);
char *str = "12345";
char str1[] = "12345";
cout<<sizeof(i)<<endl;
cout<<sizeof(a)<<endl;
cout<<sizeof(b)<<endl;
cout<<sizeof(str)<<endl;
cout<<sizeof(str1)<<endl;
3. 分析以下程序的结果
char *GetString2(void)
{
char *p = "hello world";
return p;
}
void Test(void)
{
char *str = NULL;
str = GetString2();
cout<< str << endl;
}
4. 值、指针、引用作为参数的考察
void Func1(int x)
{
x = x + 10;
}
void Func2(int *x)
{
*x = *x + 10;
}
void Func3(int &x)
{
x = x + 10;
}
void Test(void)
{
int n = 0;
Func1(n);
cout<<n;
Func2(&n);
cout<<n;
Func3(n);
cout<<n;
}
5. window编程的考察
(1)多线程的作用
(2)postmessage与sendmessage有什么区别
(3)window动态链接库有几种调用方式
6. 说出机器视觉主要的构成部分
7. 如下图,说出他们的灰度直方图是否相同,如果对它们使用模板大小为3*3的均值滤波后,灰度直方图是否还相同,为什么?
7. 如下图,设计算法得到图中凸出部分的位置(写出思路即可)
8. 英译汉。一段比较长的英文,整体不难,长难句比较少,比较生僻的词语也较少。