51
21
What general tips do you have for golfing in C++?
I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C++ (e.g. "remove comments" is not an answer). Please post one tip per answer.
(Tips that apply to C as well can be found in Tips for golfing in C - but note that some C tips don't work in C++. For example, C++ does require function prototypes and return values.)
4
Many of the tips for golfing in C are also applicable to C++, so please assume that readers are familiar with that question; only post here if you have something that isn't also a valid C golfing tip.
– Toby Speight – 2016-04-21T16:47:20.283@TobySpeight Probably because they have the same url besides the question ID. – NoOneIsHere – 2017-01-05T19:22:35.453
C and C++, even if not 'golfing' type, are right and easy (if one consider the right subset of C++) – RosLuP – 2019-08-12T21:37:33.280