unsigned char str1[]="I Love You";
int n[5];
ifstream in("xxx.xxx");
ofstream out("yyy.yyy");
out.write(str1,strlen(str1));//put the string str1 write in yyy. yyy file
in.read((unsigned char*)n,sizeof(n));//from xxx.xxx read designated integer, Note: type conversion
in.close();out.close();