RicardasSim icon

if statement with initializer

RicardasSim | PRO | 06/01/24 10:27:52 AM UTC (Edited) | 0 ⭐ | 11066 👁️ | Never ⏰ | []
C++ |

300 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
 
bool TestFnc()
{
    printf("TestFnc\n");
    return true;
}
 
int main()
{
 
    bool a = false;
 
    if( a = TestFnc(); a )
    {
        printf("1\n");
    }
    else
    {
        printf("2\n");
    }
 
    return 0;
}
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎