Hello all,
I'm approaching the end of my time at university and have been applying for a number of game development positions (programming, preferably engine/core-tech). However, I'm sad to say I have not been having much luck as of late; complete honesty: the two rejections I have so far both pretty much claim my C++ is "not yet where we need it to be". Beyond that they give no feedback so I'm unsure as to how I can improve; I appreciate some may say write more code (practice etc) but surely without some feedback to point out your weaknesses simply writing more code/practice isn't as effective as it could otherwise be?
One test for example was to write a function which given a string-based representation of an integer could produce an integer with the same value, to which I gave this solution (I'd like to reduce it to one loop if possible, however the test was timed and I had to rush a bit, I'm sure there are other optimizations that could be made). I'm just giving this as a piece of example code, I could provide more if anyone wants as I very much want to learn and improve.
int ConvertStringToInt(char *c) {
bool isNegative = false;
if(*c == 45) {
isNegative = true;
++c;
}
int size = 0;
while( *c >= 48 && *c <= 57 ) {
++size;
++c;
}
c -= size;
int returnValue = 0;
for( int i=0; i<size; ++i ) {
returnValue += (*c - 48) * std::pow(10, size-(i+1));
++c;
}
return isNegative? -returnValue : returnValue;
}
I'm not going to lie, the whole thing has me feeling very down; I'm not looking for sympathy though, I'm eager for some advice on how I can improve and hopefully do better in future applications.
Thank you everyone,
- Jamie