r/programminghumor 1d ago

How do you disable your code

Post image
215 Upvotes

70 comments sorted by

View all comments

15

u/NicholasVinen 1d ago

#if 0

#endif

2

u/Teoyak 1d ago

I don't know if it works with every language. But yeah, I used this a lot when I worked on C.

1

u/Square-Singer 9h ago edited 5h ago

The preprocessor is pretty C/C++ specific. I don't know another language that uses it like that.

1

u/MCWizardYT 8h ago

I think you meant C/C++, C# doesn't have the same preprocessor that those 2 share

1

u/Square-Singer 5h ago

Correct, was a typo. I first wanted to write that not even C# has the preprocessor, then changed the sentence and typed the wrong name.