The following code sample shows a C++ program written using the XMS API.
以下代码示例显示了一个使用 XMS API 编写的 C++ 程序。
Listing 5. C code for the sum_list program.
清单5 . sum_list程序的c代码。
Now we just need a program to convert our macro into standard C. For this simple example, Perl is used because it can evaluate user code in a string, and its syntax is largely C-like.
现在我们只需要一个程序将这个宏转换成标准的 C 语言就可以了。 对于这个简单的例子来说,我们将使用 Perl 来实现这个程序,因为它可以对字符串中的用户代码进行评测,其语法也与 C 语言非常类似。
应用推荐