软件笔试题(A)
姓名: 学校:
专业: 电话:
(如无特殊说明,以下所有测试内容都是基于32位嵌入式系统)
程序的局部变量存在于中,全局变量存在于中,动态申请数据存在于中。oid func( char str[100])
{
printf(“%d”,sizeof( str ) );
}
输出结果是:
有下列定义:
char str[] = “Hello World”;
char *p = str;
int n = 10;
void *ptr = malloc( 100 );
请写出如下表达式的值:
sizeof (str ) = ;
sizeof ( p ) = ;
sizeof ( n ) = ;
sizeof ( ptr )= ;
unsigned char *p1;unsigned long *p2;p1=(unsigned char *)0p2=(unsigned long *)0
请问p1+5 = ; p2+5 = ;
char str[10];strcpy(str,"0123456789");产生什么结果?为什么?让程序跳转到绝对地址0x去执行已知一个数组,用一个宏定义,求出的元素个数#define #ifndef __INC_Honeywell_Debug
#define __INC_Honeywell_Debug
#ifdef __cplusplus
extern "C" {
#endif
/*...*/
#ifdef __cplusplus
}
#endif
#endif /*__INC_Honeywell_Debug */
给定结构struct token_t
{
char digit:4;char index:4;unsigned short data:8;unsigned long tick;
};
问sizeof() =
在空白处填写完整强制类型转换
short (*day_p)[16];
day_p = ( ) malloc ( );
简述:TCP/UDP有何TCP/IP通信建立的过程怎样端口有什么作用?
__interrupt double compute_area (double radius) {
double area = PI * radius * radius; printf(" Area = %f", area); return area;
}
请写一个宏,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1
数组a[N],存放了1至N-1个数,其中某个数重复一次。写一个函数,找出被重复的数字函数原型:int do_dup(int a[],int N)基于如下数据结构,实现环形缓冲区的读写函数
#define BUF_SIZE(100)
typedefstructstr_data_buf
{
unsigned charwrite_index;
unsigned charread_index;
BOOLfull_flag;
BOOLempty_flag;
int data_buf[BUF_SIZE];
}data_bu