Pointers are like other primitives in that they are passed by value. If you want a method that changes what a pointer is pointing at, you need a pointer to the pointer.
I think you are saying the same thing (I definitely could be outdated, but I do not think references exist in C, they are C++). I was more just laughing at myself having the opportunity to type "pointer is pointing at, you need a pointer to the pointer"
Disclaimer: I've been in Java/Javascript now for 20 years, but was always interested in seeing if I get a different answer other than linked lists when someone has C/C++ on their resumé.
But I have an "anti-story". One time I interviewed at a hedge fund and my last interviewer asked me to name all of the options for "ls" and what they do. I told him the options I used all the time and that I would look up the others if needed. He failed me. Best "fail" of my life.
I always figure interview questions like that are the interviewer trying to secretly signal you to run away for your own good without them getting caught by their HR
I remember telling someone about "-h" and they said it changed their life. And yea, asking you to regurgitate an easily accessible man page is idiotic.
Comments
#iseewhatyoudidthere
Part of good programming is knowing when and how to look stuff up, not necessarily having memorized all the many ways to use C/C++/whatever :-)
But I have an "anti-story". One time I interviewed at a hedge fund and my last interviewer asked me to name all of the options for "ls" and what they do. I told him the options I used all the time and that I would look up the others if needed. He failed me. Best "fail" of my life.
I'm fun at parties...