写撇号签署writeln函数 - Pascal

时间:2012-11-01 09:37:43

标签: pascal

如何使用writeln函数在Pascal中打印撇号?

示例:

writeln('My brother's book');

不起作用,因为s book超出了“写入”功能,因此编译器返回错误:

Fatal: Syntax error, ")" expected but "identifier S" found
Fatal: Compilation aborted

2 个答案:

答案 0 :(得分:10)

根据the Free Pascal Reference:单引号字符可以通过键入两次嵌入字符串中:

writeln('By brother''s book');

答案 1 :(得分:0)

在Dev-Pascal 1.9.2中,您需要三个''',例如:

writeln ('My brother'''s book');