Qualcomm Interview Question

Write strcpy (string copy). What test cases would you have? Write strrev (string reverse) in place. (temp char is fine)

Interview Answers

Anonymous

Mar 2, 2012

// strrev char str[] = "Hello World"; j=0; for(i=strlen(str)-1; i<=strlen(str)/2; i--) { temp = str[j]; // swap str[j] = str[i]; str[j] = temp; j++; }

3

Anonymous

Nov 20, 2010

This is pretty easy to find the answer online already.