while (cin >> buffer) {
if (buffer[0] == '.')
break; // exit loop
...
}
You can also email the files, but will first need to use a utility like WinZip to build a compressed archive of the files. To email a binary compress ZIP archive, you need to either send it as an attachment using a MIME capable mail programs (like Eudora, Netscape Mail, Microsoft Exchange, Z-Mail, etc.) which will automatically do a "base64" character encoding of a binary file, or you can "uuencode" the file into ASCII.(You have to do this encoding because many Internet mail systems can only handle 7-bit characters, and binary files use all 8-bits in a byte).
If you are developing on Unix, you should use tar and compress (or GNU gzip) to create a compressed tar archive of your program directory, and then use a MIME capable mail program to send it as an attachment. If you don't have a MIME capable mail program (e.g., pine, mh, exmh, etc.), or you can just 'uuencode' (see man uuencode) the prog.tar.Z file and send the ASCII encoding generated by uuencode.
The options to Unix linkers are all the same. You may need the -Lpath/ to specify the path to the library, and -lname to specify the library. If you use gcc instead of g++ as the compiler command, then gcc needs a -l flag to link libg++.a which is where the iostream things (like cout) are found:
% gcc -g myprog.C -lg++If you use g++ as the driver, then it implicitly includes the -lg++ flag. The -v (verbose) option to gcc and g++ is helpful as it shows you the execution of the preprocessor (cpp), the compiler (cc1plus), the assembler (as) and the linker (ld).
If you are using Borland C++, you set the libary path by going to the Options->Project menu item and click on Directories, and set the path to the .lib files that are needed to link your program. The path is usually set to a default, which should be OK unless you moved something. If you used the TargetExpert to create a Borland IDE project, it will put some .obj and .lib files into your project by default, which are usually needed to link an executable.