如何打印在C引号? [英] How can I print a quotation mark in C?

查看:164
本文介绍了如何打印在C引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在接受采访时有人问我,

In an interview I was asked

使用打印引号的的printf()函数

我是不堪重负。即使是在他们的办公室有一台电脑,他们告诉我来试试吧。我想是这样的:

I was overwhelmed. Even in their office there was a computer and they told me to try it. I tried like this:

void main()
{
    printf("Printing quotation mark " ");
}

但我怀疑它不会编译。当编译器获取第一个它认为这是字符串的结尾,这是没有的。那么,如何才能做到这一点?

but as I suspected it doesn't compile. When the compiler gets the first " it thinks it is the end of string, which is not. So how can I achieve this?

推荐答案

试试这个:

#include <stdio.h>

int main()
{
  printf("Printing quotation mark \" ");
}

这篇关于如何打印在C引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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