Arduino Strings

This compiled for you ?
I got incompatible types error.

String str = ((char*)buf);