unsigned char add(unsigned char a, unsigned char b){ for (int i = 0; i < b; i++) ++a; return a;}
stupid way to add, but it does satisfy the requirements.
unsigned char add(unsigned char a, unsigned char b){ for (int i = 0; i < b; i++) ++a; return a;}
Quote:Original post by daniel_i_l
Thanks for all the ideas!
I just finished a few hours ago and they didn't really ask anything hard. the "hardest" thing that they asked was "what's the difference between overloading and overwriting":)
Quote:Original post by MilfredCubicleXQuote:Original post by daniel_i_l
Thanks for all the ideas!
I just finished a few hours ago and they didn't really ask anything hard. the "hardest" thing that they asked was "what's the difference between overloading and overwriting":)
What is this overwriting you speak of.
Quote:Original post by programwizardQuote:Original post by MilfredCubicleXQuote:Original post by daniel_i_l
Thanks for all the ideas!
I just finished a few hours ago and they didn't really ask anything hard. the "hardest" thing that they asked was "what's the difference between overloading and overwriting":)
What is this overwriting you speak of.
He probably meant overloading and hiding.
int add (int a, int b){ while (b != 0) { int x = a ^ b; int y = a & b; a = x; b = y << 1; } return a;}
Quote:Original post by Captain P
So the interview questions of today are limited to low-level jabbering? No questions about inheritance versus composition, design patterns and such?
I mean, I can understand why such hidden-gem questions can be usefull, it's one way to see who's actively developing him/herself and who isn't, but I'd say it's just one side of the equation... or perhaps better said, one of many facets. :)