Microsoft Interview Question
Software Engineer in Tests- creating a local storage and passing it back.
Should have allocated the memory from heap.
- 1024 size limitation but no check made of the sizes of s1, s2
can overrun the buffer.
- buffer[++i] => buffer[i++]
- not terminating the newly created string with '\0'
- function parameters should be const char
etc etc
based on below statement, you cannot pass directly S2 to index of buffer storate. You need to pass *S2. So that it will take first position of S2 Address then increment +1 every time.
- Shiva July 29, 2011Actual: buffer[++i]=s2; s2++
Expected : buffer[++i]=s2; s2++