Question: Which is better approach and why.

Answer: 
MsgBox(“a file has been modified. Do you wish to save before quitting?”)

With the following options

* Save and Quit (default, left position)
* Cancel (Center position, next to left button)
* Discard (right position, with an amount of spacing between the other buttons and this one.)

```

    The file xxx.txt has been modified.
    Do you wish to save before quitting?
```

+---------+ +--------+ +-------------+
| Discard | <---- SPACING ----> | Cancel | | Save & Quit |
+---------+ +--------+ +-------------+

NEVER EVER place the discard in between the other buttons, as this will give problems when miss-clicking. <http://www.codinghorror.com/blog/2010/03/the-opposite-of-fitts-law.html>
Something else I personally think is important is setting focus to whichever button is the equivalent to cancel. I think a lot of users get accustomed to these kind of prompts and just hit enter without even reading what is on the dialog. When they do this I think in most situations it's better to play it safe and cancel than to commit something.