This should work for ostreams, though I haven't tested it. You could modify the function to be more general by having it work on a basic_ostream, I think.
// Define after #include's
//#define endline "\n\n"; // Put as many \n as you need.
//Corrected by removing semicolon, as mentioned by Disch
#define endline "\n\n" // Put as many \n as you need.
// ...
//Now in int main()
cout << "this is a sample text " << endline;
cout << "Next printed line.." << endline;
...
The constexpr is like using const, except that the value is usable by the compiler itself instead of just by your compiled program. In the interest of being as specific and useful as possible, JLBorges made them constexpr instead of just const.
Where did you see that? If you're talking about Disch's correction, that has nothing to with globals, as #defines are preprocessor directives. http://www.cplusplus.com/doc/tutorial/preprocessor/
This may shed some light on the difference.