#include #include #include #include main() {int fd; char *buf=(char *)malloc(10); char *bufa=(char *)malloc(10); strcpy(buf,"alpha.wright.edu"); fd=strcspn(buf,"."); printf("Chars until . %d\n",fd); strncpy(bufa,buf,strcspn(buf,".")); printf("Got this much...%s\n",bufa); strncpy(bufa,bufa,strcspn(buf,".")); printf("Got this much...%s\n",bufa); getwd(buf); printf("Testing strncmp wd %s \n Result is: %d \n",buf,strncmp(buf,"/nfs",4)); }