How to comment multiple lines in a C++ module?

Hello,
I am trying to comment out several lines in a C++ module. In C++ it should be done with /* and */
But it doesn’t work (?)
I have tried other common ways used in other languages but nothing works …
Does anyone know how to do this?
Thanks in advance

Hi, Marcos.

If you’re using the built-in code editor, I just confirmed that it doesn’t visually reflect the effect of commenting out the code with /* */. You might want to use a better IDE. Visual Studio Code is free and pretty good. I can share a configuration that allows compiling with DMC from within the VSCode IDE.

Anyway, the compiler should honor the /* */.

Another way to comment out a block of code is to use “#if 0” and “#endif”. Again, the QSpice editor continues to highlight the code as if it was active.

–robert

1 Like

Hi, Robert
Sorry. I didn’t bother to test it because I was expecting to see the comments in green as when using //
I prefer using the built-in editor so I can compile and run directly from it.
Thanks for the help and information. I really appreciate it.

Robert,

Can you share your VSCode IDE configuration?

Len

Hi, Len.

I’ve published the VSCode configuration on the dev branch of my GitHub repo.

–robert

1 Like