最近比较闲,打算整理一下之前学习的关于程序语言的知识.主要的内容其实就是一边设计程序语言一边写解释器实现它.这些知识基本上来自Programming Languages and Lambda Calculi和Essentials of Programming Languages这两本书. 我还记得高中奥数竞赛培训时的老师这样说过:“解题时一定要抓住定义.” 编程和解题一样,也要抓住定义. 所以在写解释器前,得先定义好这门要解释的程序语言. 这门程序语言基于Lambda演算. 从\(\lambda
C/C++开发工程师面试题目(一)(附答案分析) 推荐:自己根据在面试中碰到做过的一些题目以及总结的题目,希望对面试的同学有所帮助. 一. 选择题 1. 下列类中( )不是输入输出流类iostream的派生类. A. fstream B. ofstream C. strstream D. ostrstream 答案:BD 解析:ofstream和ostrstream派生自ostream,而不是iostream.
1.(单选题)What will be printed when you execute the following code? class C { C() { System.out.print("C"); } } class A { C c = new C(); A() { this("A"); System.out.print("A"); } A(String s) { System.out.print(s); } } class Test
1. auto (page107) auto 推断会忽略const const int ci = i, & cr = ci; auto b = ci; // b is an int (top-level const in ci is dropped) auto c = cr; // c is an int (cr is an alias for ci whose const is top-level) auto d = & i; // d is an int*(& of an