By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,922 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,922 IT Pros & Developers. It's quick & easy.

Comment code in MS VC++

P: n/a
Hi,

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

Thanks, Vidya.

ps: apologies if wrong group.

Aug 3 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Vidya wrote:
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
Aug 4 '05 #2

P: n/a
Vidya wrote:
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
Aug 4 '05 #3

P: n/a
On Thu, 04 Aug 2005 02:15:36 GMT, Larry I Smith
<la***********@verizon.net> wrote in comp.lang.c++:
Vidya wrote:
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'


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.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Aug 4 '05 #4

P: n/a
Jack Klein wrote:
On Thu, 04 Aug 2005 02:15:36 GMT, Larry I Smith
<la***********@verizon.net> wrote in comp.lang.c++:
Vidya wrote:
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'


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.


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
Aug 4 '05 #5

P: n/a

"Vidya" <kv****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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
Aug 4 '05 #6

P: n/a
Kelly Walker wrote:
"Vidya" <kv****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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.


It doesn't. And your answer is OT anyway.
Aug 4 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.