|
华北计算机系统工程研究所 2005 年研究生入学考试试题 考试科目:专业综合 1 (本题共 21 分)简要回答下列问题。 (1) 在函数内定义的 int k, k 的作用域是_____________,生存周期是____________。 (2) 在 main 函数内定义的 float x 的作用域是_____________,生存周期是____________。 (3) 在函数内定义的 static unsigned long m 的作用域是_____________,生存周期是 ____________。 (4) 在函数外定义的 int n 的作用域是_____________,生存周期是____________。 (5) 在函数外定义的 static short int j 是___________________有效。 (6) 函数内在分程序中{ auto int i;……} 定义的 i 的作用域是__________________。 (7) 在函数内调用 malloc 函数动态分配的内存空间的生存周期是___________________ 或__________________。 (8) 用 register 定义的寄存器变量在_________有效,生存周期是____________。 2(本题共 18 分)读下列 C++程序,写出运行该程序的输出结果。(14 分) #include class Point //Point 类的声明 { public: //外部接口 Point(int xx = 0, int yy = 0) //构造函数 { X = xx; Y = yy; } Point(Point &p); //拷贝构造函数 int GetX() { return X;} int GetY() { return Y;} private: int X, Y; }; //成员函数的实现 Point::Point(Point &p) 1
,更多更新年份持续更新,请在本站的考博信息网|www.kaoboinfo.com中的“考研试卷库”学校栏目中查询下载。
|