Visual Studio 2017中的评论样式 [英] comment style in Visual Studio 2017

查看:115
本文介绍了Visual Studio 2017中的评论样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio 2017中选择一段代码并对其进行注释.我知道我可以使用CTRL + K,C,但是结果是:

I want to select a piece of code in Visual Studio 2017 and comment it. I know I can use CTRL + K, C, but the result is:

    /*fstream in("c:\\users\\hp\\documents\\visual studio 2017\\projects\\inputfile.in");
    if (!in)
    {
        cerr << "can't open input file\n";
        return 1;
    }
    fstream out("outputfile.out", fstream::out);
    if (!out)
    {
        cerr << "can't open output file\n";
        return 1;
    }*/

我真正想要的是

    //fstream in("c:\\users\\hp\\documents\\visual studio 2017\\projects\\inputfile.in");
    //if (!in)
    //{
    //    cerr << "can't open input file\n";
    //    return 1;
    //}
    //fstream out("outputfile.out", fstream::out);
    //if (!out)
    //{
    //    cerr << "can't open output file\n";
    //    return 1;
    //}

我该怎么做?
我搜索了互联网,但找不到该问题的答案.

How do I do this?
I searched the internet, but I didn't find the answer to this question.

推荐答案

我找到了答案,但是我只能使用屏幕截图对其进行解释.
因此,如果要使用/.../样式,请选择如下代码:

I found myself the answer, but I can explain it only using screenshots.
So if I want to use the /.../ style, I select the code like this:

如果我想使用//样式,则选择如下代码:

And if I want to use the // style, I select the code like this:

这篇关于Visual Studio 2017中的评论样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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