HITEQUEST
technical interview Q & A for high-tech professionals
 
 
Interview Questions
Electronics Hardware
Computer Software
General questions
Brain teasers

Resources
Resume and interview
How to get a job in Silicon Valley
How much are you worth on market?
Do you need an agent?

Break time stories
Tomato company

About Hitequest
About Hitequest
Join us
Home page

 
 
 
 
 
 
   

 
=Computer Software Questions=

     
   

Q:
What do you think can be wrong with this function?

char* NewString(char* string1)
{
int i=0;
char* string2[20];
while (i<19 && *(string1+i) != '\0')
{
string2[i] = toupper (*(string1+i));
++i;
}
string2[i] = '\0';
return string2;
}

 
 
 
 
 
 

A:hint from Hitequest
It is not a good idea to return a pointer to a local var.