Question: I know a handler is bound to the thread's message queue in which it is created, but what if i create a handler in a service and posting a runnable declared in activity to which my service is bound.
For example:
In service:-

```
Handler handler=new Handler();
handler.post(Mainactivity.runnable);

In activity inside oncreate method:-

Runnable runnable=new Runnable(){
    public void run{
       //some code here
    }
};

```

Can someone please explain me what's happening here?

Answer: 
Macro-replacement is basically what it sounds like, it replaces the macro with the body of the macro, quite literally.

So when you have

```
a[i] = round(a[i]);

```

It will be replaced by

```
a[i] = {  return (a[i] >=0)? (int)(a[i]+0.5) : (int)(a[i]-0.5) ; };

```

That's not valid syntax. The right-hand side of an assignment must be an expression and not a statement.

A simple solution is to turn `round` from a macro to an actual function. An even simpler solution is to realize that `int` values (`a[i]` is an `int`) doesn't have fractions, so there's nothing to round.

If you want to use floating-point values though, the *correct* solution is to use the standard [`round`](http://en.cppreference.com/w/c/numeric/math/round) function, not to make up your own.
You don't need the `return` keyword, it's not a function. Get rid of it.

Quoting `C11`, chapter §6.8.6.4

> 
> A `return` statement terminates execution of the **current function and returns control to
>  its caller.** [...]
> 
> 
> 

which is **not** the purpose of your MACRO definition. Inclusion of `return` keyword is unwanted and invalid syntax there.

What you probably want is a syntax like

```
  (N >=0)? (int)(N+0.5) : (int)(N-0.5)

```

or, something better

```
 ( (N) >=0)? (int)((N)+0.5) : (int)((N)-0.5)

```

without the `return` and maybe the trailing `;` also.