473,486 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to add "/*" in C++ comments?

I'm using gcc 3.2.3.
I'd like to add some detailed tutorial to my comments about the usage of
the code. The tutoril includes some URI like "./ABC/CDE/*". The compiler
thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?
Thanks
Jul 23 '05 #1
9 2150

Morgan Cheng wrote:
I'm using gcc 3.2.3.
I'd like to add some detailed tutorial to my comments about the usage of the code. The tutoril includes some URI like "./ABC/CDE/*". The compiler thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?
Thanks

use //* example: /* //* tutorial //* */

Jul 23 '05 #2

Morgan Cheng wrote:
I'm using gcc 3.2.3.
I'd like to add some detailed tutorial to my comments about the usage of the code. The tutoril includes some URI like "./ABC/CDE/*". The compiler thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?
Thanks


For multi-line comments, I prefer to use "#if 0" and "#endif":

someCode();
#if 0
multiline comment
goes here
#endif
moreCode();

This has several advantages:
-> solves your problem regarding the closing */
-> allows you to create "nested" comments (easier when debugging)
-shez-

Jul 23 '05 #3
Morgan asked:
I'd like to add some detailed tutorial to my comments about the usage of
the code. The tutoril includes some URI like "./ABC/CDE/*". The compiler
thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?


Is there any reason not to use "//" comments ? Example:

// The files match the pattern ./ABC/DEF/*

David Fisher
Sydney, Australia
Jul 23 '05 #4

shez wrote:
Morgan Cheng wrote:
I'm using gcc 3.2.3.
I'd like to add some detailed tutorial to my comments about the
usage of
the code. The tutoril includes some URI like "./ABC/CDE/*". The

compiler
thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?
Thanks


For multi-line comments, I prefer to use "#if 0" and "#endif":

someCode();
#if 0
multiline comment
goes here
#endif
moreCode();

This has several advantages:
-> solves your problem regarding the closing */
-> allows you to create "nested" comments (easier when debugging)
-shez-


shez could you illistrate with an example?

Jul 23 '05 #5

shez wrote:
Morgan Cheng wrote:
I'm using gcc 3.2.3.
I'd like to add some detailed tutorial to my comments about the
usage of
the code. The tutoril includes some URI like "./ABC/CDE/*". The

compiler
thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?
Thanks


For multi-line comments, I prefer to use "#if 0" and "#endif":

someCode();
#if 0
multiline comment
goes here
#endif
moreCode();

This has several advantages:
-> solves your problem regarding the closing */
-> allows you to create "nested" comments (easier when debugging)
-shez-


Jul 23 '05 #6
On Tue, 25 Jan 2005 13:53:51 +1100, "David Fisher" <da***@hsa.com.au>
wrote:
Morgan asked:
I'd like to add some detailed tutorial to my comments about the usage of
the code. The tutoril includes some URI like "./ABC/CDE/*". The compiler
thinks that I am using "/*" in "/* */" and doesn't pass.
Is there any solution to add "/*" in "/* */" comments?


Is there any reason not to use "//" comments ? Example:

// The files match the pattern ./ABC/DEF/*


That works for single line comments, but detailed tutorials can be a little
cumbersome. The "#if 0" or "/*" are normally preferred for multi-line, as
they are much easier to work with (especially with word-wrap enabled, as on
most newsreaders.)

As for the OP, GCC 3.4.3 compiles "./ABC/CDE/*" without problem, aside from
an optional warning. It only becomes an issue if you try something fancy
like "/dev/*/*".
Jul 23 '05 #7
puzzlecracker wrote:
shez wrote:
For multi-line comments, I prefer to use "#if 0" and "#endif":

someCode();
#if 0
multiline comment
goes here
#endif
moreCode();
shez could you illistrate with an example?


He already did!
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting

Jul 23 '05 #8
Dietmar Kuehl wrote:
puzzlecracker wrote:
shez wrote:
> For multi-line comments, I prefer to use "#if 0" and "#endif":
>
> someCode();
> #if 0
> multiline comment
> goes here
> #endif
> moreCode();

shez could you illistrate with an example?


He already did!


I can't see any /* in the above lines.

Jul 23 '05 #9

Rolf Magnus wrote:
Dietmar Kuehl wrote:
puzzlecracker wrote:
shez wrote:
> For multi-line comments, I prefer to use "#if 0" and "#endif":
>
> someCode();
> #if 0
> multiline comment
> goes here
> #endif
> moreCode();

shez could you illistrate with an example?


He already did!


I can't see any /* in the above lines.


Here you go:
> someCode();
> #if 0
> multiline comment /* dsd */* whatever i want
> goes here
> #endif
> moreCode();


Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
6313
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
0
1345
by: Trebor A. Rude | last post by:
I'm new to Perl (although I have about 7 years of C++ experience), and I was just wondering which of these two equivalent statements the group thinks is "better", and why: push @command, map...
4
1784
by: dmiller23462 | last post by:
Somebody take a look and give me any suggestions? My brain is nuked... Here's my deal....I have online submission forms on my intranet at work here....I am appending to an Access DB with the...
2
6276
by: dmiller23462 | last post by:
Hey guys, I'm back again....I've got the results displaying that I wanted but instead of having a "next" or "previous" link displayed I am getting the error msg below (I actually get the data that...
32
4093
by: James Curran | last post by:
I'd like to make the following proposal for a new feature for the C# language. I have no connection with the C# team at Microsoft. I'm posting it here to gather input to refine it, in an "open...
1
16183
by: DJ DIGI | last post by:
Hello Everyone, I'm attempting to design a small web app to obtain customer feedback. The issue is when a user inputs >4000 characters in the COMMENTS section I get the following Err Msg: ...
9
1269
by: Gary | last post by:
Hi all! I've taken some time on learning the difference between "pointers to const variables" and "const pointer variables". The question is: in the following code, can we change the contents of...
12
3004
by: Matthew Wilson | last post by:
Hi, we are getting a lot of spam through our PHP Feedback form, and have set up a new field 'prove you're human', asking them to do some simple maths. What is the command for the PHP script...
14
4335
by: confusedfusion | last post by:
Not sure how many form submissions that have been lost over the years before I started but the company has a contact form that the required fields when validation fails the error message is going...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.