Home » C Programming » Tutorial » Comments in C
Comments in C language are used to provide information about the code. It is widely used for documenting the code and mostly above the code. A comment starts with a slash asterisk /* and ends with a asterisk slash */ and can be anywhere in your program. Comments can span several lines within your C program.
Syntax of Comment
/* comment goes here */
Example of Comments
/* include the header file */ #include /* this function calculates sum of two integer values */ int sum(int, int); int main() { } int sum(int a, int b) { return a+b; }
Multiline Comment
/* * Author: CppBuzz.com * Purpose: Function to calulate sum of two int number * Language: C * Date : 05/05/2018 */
C Tutorial
- History of C Language
- The First Program in C
- Compilation & Execution
- Compile C on Dev-C++
- Compile C on GCC Linux
- Variable & Data types
- Comments
- Storage Classes
- Conidtional Statements
- Switch Cases
- Loops (for, while, do-while)
- Arrays
- Pointers
- Function Pointer
- Strings & Library func
- Formated I/O
- Structure
- Enum
- Union
- File I/O
- Memory Management
- Error Handling
- Type Casting