如何产生的CPP宏换行? [英] How to generate a newline in a cpp macro?

查看:172
本文介绍了如何产生的CPP宏换行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样写一段cpp的宏观其扩展到包括换行符?

How do I write a cpp macro which expands to include newlines?

推荐答案

C&放大器; C ++编译器忽略未加引号的空格(除>>模板的问题),因此让宏发出新行并没有真正意义。您可以结束与反斜杠宏观的每一行作出宏跨越几行,但不输出换行。

C & C++ compilers ignore unquoted whitespace (except for the > > template issue), so getting a macro to emit newlines doesn't really make sense. You can make a macro span several lines by ending each line of the macro with a backslash, but this doesn't output newlines.

这篇关于如何产生的CPP宏换行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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