Domanda di colloquio di Qualcomm

void foo(char*a, char*b){ while(*a++ = *b**); return; } int main(){ char buf[20]; foo(buff,"Hello"); printf("%s",buff); } what is the output for this program?

Risposte di colloquio

Anonimo

31 ott 2013

There are two typos in the question corrected question below void foo(char*a, char*b){ while(*a++ = *b++); return; } int main(){ char buf[20]; foo(buf,"Hello"); printf("%s",buff); } out put: Hello

2

Anonimo

26 feb 2010

Are you sure it is while(*a++ = *b**); not while(*a++=*b++)

1