lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On Mon, Sep 15, 2014 at 10:41 PM, Tim Hill <drtimhill@gmail.com> wrote:

Indeed. One of my interview questions for a C applicant is:

int k = 1;
k = k++ + ++k;

What is the value of k?

I get the most joy out of scaring people with k = (k++, ++k, k + k, k) 

I love how in C++11/C11 they made things even /sequenced/ just to fuck with people (but also to give compilers more freedom for optimization).

Also this is a very good read for anybody else learning C* (or going in for interviews): http://auditty.org/info/deep-c.pdf