Mega Code Archive

 
Categories / C / Code Snippets
 

Comments in C

/* This is a single line comment */ /* * This is a mult-line * comment. */ int main() { /* A procedure */ int j; /* Comment / code line */ char charArray[10]; strcpy(charArray, "xyz"); /* String */ strcpy(charArray, "a\"yz"); /* String with quotation */ charArray[0] = 'a'; /* Character */ charArray[1] = '\''; /* Character with escape */ j = 3 / 2; /* Slash that's not a commment, divide operator */ j = 3; /* Normal number */ j = 0x123ABC; /* Hex number */ j = ((1 + 2) * /* Nested () */ (3 + 4)); { int j; /* Nested {} */ } return (0); }