Posts

Showing posts with the label cpp comment

C++ Comments

Image
C++ Comments Every comment-program is the explanatory statement that we also include in the C++ code. The comment statements can help anyone to understand each processing step by step by reading from the source code. All programming languages always allow for some forms of comments, but in different forms of each programming language. The C++ comments support single-line and multiple-line. All characters must be available inside any comment and always ignored by the compiler of C++. Normally, C++ comments start with /* and end with */. For example: /*This is my comment in single-line*/ /*This my comment in multiple-line *C++ can also support for multiple-line */ We can also extending the comment at the of each line with //. For example: #include<iostream> using namespace std; main(){  cout<<"Hello World!"; //Prints Hello World! return 0; } When compiling the source code above, the compiler will ignore / /Prints Hello World!, So the fin...

ភាសាកម្មវិធី C++៖ ការអត្ថាធិប្បាយ

Image
  ការអត្ថាធិប្បាយ Comments ការប្រើប្រាស់ Comments ក្នុងភាសាកម្មវិធី C++ (Using comments in C++)     Comment មានសារៈសំខាន់ណាស់សម្រាប់អ្នកសរសេរកម្មវិធី ។វាធ្វើអោយយើងងាយស្រួលយល់ពីកូដដែលបានសរសេរពីមុនៗមក រាល់ពេលបើកមើលលើកក្រោយទៀត ។ គេប្រើការអធិប្បាយ (Comments) សម្រាប់កត់ចំណាំ ឬពណ៌នាអំពីកូដ ។ ជាទូទៅការអធិប្បាយ (Comments) មានទម្រង់ដូចខាងក្រោម៖  ការអធិប្បាយមួយជួរ (Single-line comments)      ការអធិប្បាយមួយជួរ (Single-line comments) ផ្ដើមដោយសញ្ញា forward slashes (//) ។ អត្ថបទណាមួយដែលស្ថិតនៅរវាង // និងចុងបញ្ចប់នៃជួរបន្ទាត់ នឹងមិនត្រូវបានប្រតិបត្តិទេ (will not be executed) ។ // This is my comment in single-line ឧទាហរណ៍៖  ការអធិប្បាយច្រើនជួរ (Multiple-line comments)      ការអធិប្បាយច្រើនជួរ (Multiple-line comments) ផ្ដើមដោយ /* និង បញ្ចប់ដោយ */ ។ អត្ថបទណាមួយដែលស្ថិតនៅរវាង /* និង */ នឹងមិនត្រូវបានប្រតិបត្តិទេ (will not be executed) ។ /*This my comment in multiple-line *C++ can also support for multiple-line */ ឧទាហរណ៍៖

How to add Comments in C++

How to add Comments in C++ Every comment-program is the explanation statement that we also include in the C++ code. The comment statements can help anyone to understand each processing steps by steps by reading from the source code. All programming languages always allow for some forms of comments, but in different forms of each programming language. The C++ comments support single-line and multiple-line. All characters must be available inside any comment and always ignored by the compiler of C++. Normally, C++ comments start with /* and end with */. For example: /*This is my comment in single-line*/ /*This my comment in multiple-line *C++ can also support for multiple-line */ We can also extending the comment at the of each line with //. For example: #include<iostream> using namespace std; main(){  cout<<"Hello World!"; //Prints Hello World! return 0; } When compile the source code above, the compiler will ignore / /Prints Hello World...