Domanda di colloquio di Intuit

Write a function to perform string copy using pointers

Risposta di colloquio

Anonimo

4 lug 2012

void main() { char* string1="Hello there"; char* string2 = (char*)malloc(sizeof(strlen(string1))); copyString(string1,string2); } void copyString(char* x, char* y) { int i=0; while(x[i]!=0) { y[i]=x[i];i++; } y[i]=0; }

1