Conditional Compilation In C:

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • technotip.com/...
    In this video tutorial lets learn about preprocessor command or directives like #if, #elif, #else and #endif. These directives are used in conditional compilation.
    How Does #if and #elif Work?
    The block of code inside #if block works only if the condition or the expression in resolved to 0 or non-zero. If the expression is resolved to zero, then the code inside #if is skipped from compilation. If it’s non-zero number, then the code inside #if block gets compiled and executed.
    Same is true for #elif: If the condition or the expression is resolved to 0 then the code inside #elif block is skipped from compilation. If it’s resolved to non-zero number then the block of code inside #elif gets compiled and executed.
    C Programming Interview / Viva Q&A List
    technotip.com/...
    C Programming: Beginner To Advance To Expert
    technotip.com/...

КОМЕНТАРІ • 11

  • @rishikeshpandey2211
    @rishikeshpandey2211 4 роки тому +3

    Awesome discovery for me😍

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому +1

      :)

    • @rishikeshpandey2211
      @rishikeshpandey2211 4 роки тому +1

      I have a question
      How to remove all the comments in c source code

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому +1

      We've to manually remove it from the source code. OR use regular expression and remove everything between /* and */

    • @rishikeshpandey2211
      @rishikeshpandey2211 4 роки тому +1

      Can u help it using regular expression...
      I will too try

    • @technotipDOTorg
      @technotipDOTorg  4 роки тому +1

      It's not C code by the way. You could use some JS framework or any language that supports regular expression. Then use command prompt and pass your C Source Code file path along with the regular expression.

  • @nidhinkk3091
    @nidhinkk3091 3 роки тому

    You are not explaining the point here. We could use Normal if , elseif, else... Why use #if, what is the real time usecase for using this macro.

    • @technotipDOTorg
      @technotipDOTorg  2 роки тому +1

      I've explained it in a video before this. It's good if you watch the videos in the order I've published it. You can get the ordered list on our blog(link to which is present in the description section of above UA-cam video). Thank you ..

  • @victorstroganov8135
    @victorstroganov8135 2 роки тому

    So you're telling me that I am not excellent? 😭

  • @adrianorodrigues6902
    @adrianorodrigues6902 3 роки тому

    Agora faz sentido, thank you