This site features a collection of common technical interview questions gathered by a group of programmers who have been through, and given, lots of technical interviews. There is an emphasis on C++ and game programming technical interviews, but most of the questions are relevant to any technical interview.
I’m a Zero

Complete the following function to clear a block of memory (initialize all the bits to zero). The block of memory starts at pStartByte, and is numBytes long.

void clearMemory(void *pStartByte, int numBytes)
{

1 Comment so far
Leave a comment

void clearMemory(void *pStartByte, int numBytes) {
if (pStartByte == NULL) {
return;
}
char* buffer = (char*)pStartByte;
while (numBytes–) {
*buffer++ = ‘’;
}
}



Leave a comment
If you are including code in your comment, place it within a <div class='code'></div> tag for better formatting.


Do you have a technical interview question you would like to submit? Some tips you would like to pass on? Just want to say hi? Feel free to contact us