This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* The following code romves all C-language comments and empty lines. */ | |
for(uint64_t i = 0; i < strlen(src); i++) { | |
// One line comment: | |
if((src[i] == '/') && (src[i+1] == '/')) { | |
for( ;src[i] != '\n'; i++) {} // Comment ends to a newline - search for the end. | |
for( ;src[i+1] == '\n'; i++) {} // Remove extra trailing newlines. | |
continue; | |
} | |
// Block comment: |
NewerOlder