简体   繁体   English

为什么我的 c++ 评论没有在 VS 代码中关闭?

[英]Why isn't my c++ comment closing in VS code?

I'm not understanding why my block comment won't close using /* */我不明白为什么我的块注释不会使用 /* */ 关闭

/* 
Name:                                Net ID: 
Course:                                    Assignment: Part 1
Programming Environment: WSl VS Code
                         C++ compiler- g++
                         C++ debugger- gdb
Purpose of File: Generate lexical analyzer using flex

 */

快照

It's recognizing /* */ if used in the same line, but nothing more.如果在同一行中使用,它会识别 /* */,但仅此而已。 I just downloaded VS code, though I am somewhat familiar with c++ and this has me stumped..I apologize for the noobie question.我刚刚下载了 VS 代码,但我对 c++ 有点熟悉,这让我很困惑。我为菜鸟问题道歉。 Thank you in advance for any guidance on this issue I'm having.提前感谢您对我遇到的这个问题的任何指导。

You can put comments into a (f)lex scanner definition, but they must not touch the left margin.您可以将注释放入 (f)lex 扫描器定义中,但它们不能触及左边距。 Every line of the comment must be indented by at least one space or tab.注释的每一行必须至少缩进一个空格或制表符。

I don't know if VS code really understands (f)lex syntax, but you'll have to indent your comments in order to process the file with flex.我不知道 VS 代码是否真的理解 (f)lex 语法,但您必须缩进注释才能使用 flex 处理文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM