Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6604913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:13:13+00:00 2026-05-25T19:13:13+00:00

let’s assume I have the followin code #define CHECK(result) do{ \ if(result == 0)

  • 0

let’s assume I have the followin code

#define CHECK(result) do{                         \
                          if(result == 0)         \
                                 return false;    \
                           } while(0)


int sum(int a, int b){

    return (a + b);
}

int main(){
   int a = b = 0;
   CHECK(sum(a + b));
   reutnr 0;
}

my question is what is an order of evaluation in C, I mean:

result = sum(a, b) 
//and only after checking              
if(result == 0)         
   return false;    

or

if(sum(a + b) == 0)         
   return false; 

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:13:14+00:00Added an answer on May 25, 2026 at 7:13 pm

    The macro substitution will be done before the actual compiler even sees the code, so the code that is compiled will read

    int main(){
      int a = b = 0;
      do {
        if(sum(a+b) == 0)
         return false;
      } while(0);
      reutnr 0;
    }
    

    There will never be a variable called result.

    Also note that C does not have a keyword called false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose we have: Class Foo{ int x,y; int setFoo(); } int Foo::setFoo(){ return
Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \
Let's say I have this code: <p dataname=description> Hello this is a description. <a
Let say I have some code HTML code: <ul> <li> <h1>Title 1</h1> <p>Text 1</p>
Let's suppose I have this piece of code. foreach(string value in myList) { string
Let's say i have this block of code, <div id=id1> This is some text
Let's consider the following scenario: a function which can generate code colors from white
Let's say i have two tables in db: Car and Part. Car owns arbitrialy
Let's assume that I am at manual A. I press enter and I am
Let’s say I have a number like 0x448 . In binary this is 0100

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.