在 writeln 函数中写撇号 - Pascal [英] Write apostrophe sign in writeln function - Pascal

查看:60
本文介绍了在 writeln 函数中写撇号 - Pascal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How can I print the apostrophe sign in Pascal using the writeln function?

示例:

writeln('My brother's book');

不能工作,因为的书没有写"函数,所以编译器返回一个错误:

wouldn't work because s book is out of "writing" function, so the compiler returns an error:

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

推荐答案

根据 Free Pascal 参考:可以通过键入两次将单引号字符嵌入到字符串中:

According to the Free Pascal Reference: The single quote character can be embedded in the string by typing it twice:

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

这篇关于在 writeln 函数中写撇号 - Pascal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆