logoalt Hacker News

sgerenser • today at 1:35 AM • 3 replies • view on HN

How many C++ programs, particularly ones looking to be compiled with a modern compiler, use octal literals? I’ve personally never seen them used in my 20 years of using C++. Maybe something dealing with Unix file permissions?


Replies

ogoffart • today at 6:37 AM

I have seen them, but it was mostly using leading 0 to align numbers, not realizing it was octal.

omoikane • today at 3:11 AM

They have a few examples linked from the page above, and it's basically permissions and file stats, e.g. "IFMT = 00170000", "#define S_IRUSR 0000400", that kind of thing.