# Impact of endl

**URL:** <https://discuss.codechef.com/t/impact-of-endl/48954>\
**Category:** faq\
**Created:** [January 5, 2020, 9:33am UTC](https://discuss.codechef.com/t/impact-of-endl/48954 "2020-01-05T09:33:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 9:33am UTC](https://discuss.codechef.com/t/impact-of-endl/48954/1 "2020-01-05T09:33:33Z")

</div>

“\n” is better than endl

---

<div class="post-metadata">

**Author:** ![ashokshaun](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ashokshaun/32/28413_2.png) [@ashokshaun](https://discuss.codechef.com/u/ashokshaun)\
**Post date:** [January 5, 2020, 4:44pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/6 "2020-01-05T16:44:14Z")

</div>

why are u posting abt problems of ongoing contests and tagging others

who cares abt how u solved a problem???  
people will figure out everything on their own

---

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 5:28pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/7 "2020-01-05T17:28:26Z")

</div>

@ashokshaun when constraints fit the time limit in such a way that even [endl Vs “\n”] matters posting such questions and tagging relevant people matters right : ) . So no one is discussing algorithm related to ongoing contest problems here. Happy coding.

---

<div class="post-metadata">

**Author:** ![ashokshaun](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ashokshaun/32/28413_2.png) [@ashokshaun](https://discuss.codechef.com/u/ashokshaun)\
**Post date:** [January 5, 2020, 5:44pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/8 "2020-01-05T17:44:11Z")

</div>

@anon8049083  
i understand ur concern..but when i commented ,someone discussed their approach in the comments(maybe its deleted now)…so i wrote that comment and not to offend anyone

u can make a post saying how useful is \n but mentioning the particular problem and context is not a very good thing in my opinion…

> [@anon8049083](#):
>
> even [endl Vs “\n”]

no.. this happens many times …not just here …even in other problems and other contests…so  
“\n is not just \n”  
its so powerful

---

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 5:51pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/9 "2020-01-05T17:51:03Z")

</div>

I got used to endl so I didn’t know that endl vs “\n” matters. Yeah realized today 😊

---

<div class="post-metadata">

**Author:** ![ashokshaun](https://discuss.codechef.com/user_avatar/discuss.codechef.com/ashokshaun/32/28413_2.png) [@ashokshaun](https://discuss.codechef.com/u/ashokshaun)\
**Post date:** [January 5, 2020, 5:55pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/10 "2020-01-05T17:55:38Z")

</div>

😀😀  
i got tle so many times and sometimes even system tests failed 😅 just because of endl  
so these days whenever i write in c++  
i always write  
#define endl “\n”

---

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 6:05pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/11 "2020-01-05T18:05:36Z")

</div>

yeah it works  
`#define endl '\n'`  
I used to think that using keywords as macros flags an error but that’s a wrong perception 🙂  
Now I don’t have to change my habit 🙃

---

<div class="post-metadata">

**Author:** ![l\_returns](https://discuss.codechef.com/user_avatar/discuss.codechef.com/l_returns/32/233293_2.png) [@l\_returns](https://discuss.codechef.com/u/l_returns)\
**Post date:** [January 5, 2020, 6:28pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/12 "2020-01-05T18:28:35Z")

</div>

> [@anon8049083](#):
>
> when constraints fit the time limit in such a way that even [endl Vs “\n”] matters posting such questions and tagging relevant people matters right : )

I disagree. Why are you posting this publicly ?  
Ask in comments section. If found appropriate then they will change time limits.  
endl vs \n is a very common and known optimization. You are expected to know this.  
Especially for 6th que of long challenge.

---

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 6:33pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/13 "2020-01-05T18:33:43Z")

</div>

@l_returns Yep, I’ll not repeat this

---

<div class="post-metadata">

**Author:** ![anon8049083](https://www.codechef.com/sites/all/themes/abessive/images/user_default_thumb.jpg) [@anon8049083](https://discuss.codechef.com/u/anon8049083)\
**Post date:** [January 5, 2020, 6:36pm UTC](https://discuss.codechef.com/t/impact-of-endl/48954/14 "2020-01-05T18:36:58Z")

</div>

Peace
