frank1369blogger's blog

By frank1369blogger, history, 5 years ago, In English

Ive seen a lot of people use this structure in their code:

ifdef LOCAL

(Part of code that works locally)

else

(The previous part doesn't work in online mode)

endif

instead of LOCAL some other strings can be written too. What I want to know is how to make this structure work. how to make ifdef LOCAL work?

btw Im using devc++.

thanks in advance for helping.

| Write comment?
»
5 years ago, # |
  Vote: I like it +11 Vote: I do not like it

Add -DLOCAL to compiler command line

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes but the problem is that where is compiler command line? this was my actual problem...

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Look it up for your IDE. Something like "dev c++ edit compiler flags".

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    how?

    • »
      »
      »
      2 years ago, # ^ |
        Vote: I like it -10 Vote: I do not like it

      can you please read what's already written above

      • »
        »
        »
        »
        2 years ago, # ^ |
        Rev. 2   Vote: I like it +1 Vote: I do not like it

        I asked to a friend so you gotta add it after you write g++. He doesn't explains it well. And you're toxic.