Comment code in MS VC++

V

Vidya

Hi,

Is there an option in Microsoft Visual C++ 6.0 to comment/uncomment
chunks of code ?

Thanks, Vidya.

ps: apologies if wrong group.
 
V

Victor Bazarov

Vidya said:
Is there an option in Microsoft Visual C++ 6.0 to comment/uncomment
chunks of code ?

Thanks, Vidya.

ps: apologies if wrong group.

Wrong group. Please ask in microsoft.public.vc.ide_general

V
 
L

Larry I Smith

Vidya said:
Hi,

Is there an option in Microsoft Visual C++ 6.0 to comment/uncomment
chunks of code ?

Thanks, Vidya.

ps: apologies if wrong group.


some code
...
...
...
#if 0
this code is 'commented out'
...
...
...
#endif
some more code
....
....

The '#if 0' appraoch works for any C/C++ compiler.

Regards,
Larry
 
J

Jack Klein

some code
...
...
...
#if 0
this code is 'commented out'

No, it is not.
...
...
...
#endif
some more code
...
...

The '#if 0' appraoch works for any C/C++ compiler.

Regards,
Larry

There are differences. Code that is conditionally excluded can
generate parse errors from the preprocessor. That is because the
preprocessor must parse it, looking for a corresponding #endif, or
even more nested #if or #ifdef and #endif pairs.
 
L

Larry I Smith

Jack said:
No, it is not.


There are differences. Code that is conditionally excluded can
generate parse errors from the preprocessor. That is because the
preprocessor must parse it, looking for a corresponding #endif, or
even more nested #if or #ifdef and #endif pairs.

Details, details.....

Yes, you're correct. However the OP asked how to "comment/uncomment
chunks of code". Although the approach is not a comment, it
accomplishes the OP's goal, and is an often used technique.

Regards,
Larry
 
K

Kelly Walker

Vidya said:
Hi,

Is there an option in Microsoft Visual C++ 6.0 to comment/uncomment
chunks of code ?

Thanks, Vidya.

ps: apologies if wrong group.

Ctrl+K, Ctrl+C (comment) and Ctrl+K, Ctrl+U (uncomment) works in MSVC++ 7.0
and may work in 6.0.

-Kelly
 
V

Victor Bazarov

Kelly said:
Ctrl+K, Ctrl+C (comment) and Ctrl+K, Ctrl+U (uncomment) works in
MSVC++ 7.0 and may work in 6.0.

It doesn't. And your answer is OT anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top