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

Comments

P: 12
What is the difference between // and /* style comments?
Mar 22 '07 #1
Share this Question
Share on Google+
4 Replies


Banfa
Expert Mod 5K+
P: 8,916
Strictly speaking // comments are C++ and C compilers do not support them. However many (but not all) C compilers today do support them.

// is a single line comment, the comment ends at the end of the line

/* ... */ has a comment closing mark and can span more than 1 line. The comment ends at the closing marker */ Because of this it is slightly more susceptable to error from accidentally nesting comments.
Mar 22 '07 #2

P: 12
Strictly speaking // comments are C++ and C compilers do not support them. However many (but not all) C compilers today do support them.

// is a single line comment, the comment ends at the end of the line

/* ... */ has a comment closing mark and can span more than 1 line. The comment ends at the closing marker */ Because of this it is slightly more susceptable to error from accidentally nesting comments.
Thank you !!!

What does the #include do?
Mar 22 '07 #3

Banfa
Expert Mod 5K+
P: 8,916
You can find the answer to this and the other basic questions you are asking by

looking in your text book

looking in your compiler documentation

performing a quick google search
Mar 22 '07 #4

RedSon
Expert 5K+
P: 5,000
Beck, its time for you to read a book about c/c++ programming.

Here is a site to get you started:

http://www.cplusplus.com/doc/tutorial/
Mar 22 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.