Answers for "how to make a debug in c"


how to make a debug in c

#include <stdio.h>

#define DEBUG 1 // Set to 0 for no debug

#if DEBUG // check if debug is 1

#define LOG(X) printf(X) // define log as printf

#else // if debug not 1

#DEFINE LOG(X) // define log as nothing

#endif // end

void main(void) {
  	LOG("Hello, Debug!\n");
	printf("Hello, World!\n");
Posted by: Guest on September-18-2020

Code answers related to "C"

Browse Popular Code Answers by Language