S9M0N_R3L3Y_GH05T's blog

By S9M0N_R3L3Y_GH05T, history, 22 months ago, In English

I use a header named printContainer.h for printing STL containers for debugging purposes, but I always have to comment it out before submission , sometimes I forget and get Compilation error which causes much problem and most importantly every second counts here... my template is like this:

#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include<iomanip>
#include<cstring>
#include <queue>
#include "Templates/printContainer.h"

//Rest of the code

please tell me what to do? I heard ifdef or endif works but I couldn't make it work...maybe I am using the wrong way.

  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
22 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it
#ifndef ONLINE_JUDGE
#include "Templates/printContainer.h"
#endif
»
22 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

#ifndef ONLINE_JUDGE #include "Templates/printContainer.h" #else // define functions defined in template as empty as shown in comments below // #define debug(...) ; // #define crndl ; #endif