Re: low-level question



>>From the ad:

Still I wonder what they are looking for with:
"How could you prevent this outcome without changing the code?"

This is an
"
ASM/C Developer/Analyst - Linux platform

Developer/analyst with strong skills in assembler and C on Linux.
"

=============

QUIZ QUESTION:

If you can answer this question intelligently, you are guaranteed an
interview (please remember to attach your resume):

Why does the following program output a 0? Explain in detail. How
could you prevent this outcome without changing the code?

#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
int i = 1;
char buf[4];
strcpy(buf, "AAAA");
printf("%d\n", i);
return 0;
}

.



Relevant Pages