i am just starting to learn C and had a simple question for anyone that would like to answer. i picked up a book called Visual Quickstart Guide: C Programming by Larry Ullman and Marc Liyanage. in the book it makes reference to commenting using the /* comment */ style but i have seen one comment using // with no end comment or anything like */. example from the book
Code:
/* hello3.c - Script 1.4
* Created by Larry Ullman 5/6/2004
* This script says "Hello, world!"
*/
#include <stdio.h>
int main (void) {
printf("Hello, world!");
getchar(); // wait for the user before continuing.
return 0;
}
now the commenting is understandable but i was wondering which is best to use? i have seen all types of commenting styles from # to ! to /* to //.
i hope that this isn't a stupid question and that it really doesn't relate to actual coding but i would like to remain standard so that my comments are readable to the rest of the world since i plan on making all my future code open source.
thanks in advance
Joe
*any mistakes in the code are due to typo of me.