To compile a C++ program on Solaris computers at Foothill College: supply the source code as an ASCII text file using a text editor or sftp, compile it using the c++ command followed by the file name, and execute the resulting a.out file using ./a.out, which will display any output.
To compile a C++ program on Solaris computers at Foothill College: supply the source code as an ASCII text file using a text editor or sftp, compile it using the c++ command followed by the file name, and execute the resulting a.out file using ./a.out, which will display any output.
To compile a C++ program on Solaris computers at Foothill College: supply the source code as an ASCII text file using a text editor or sftp, compile it using the c++ command followed by the file name, and execute the resulting a.out file using ./a.out, which will display any output.
Generated by Foxit PDF Creator Foxit Software http://www.foxitsoftware.com For evaluation only.
How to compile a c++ program on the Foothill online Solaris computers.
You will have to supply a ASCII text file as the source code to compile This can be done by a) using a text editor such as nano or vi or b) using sftp to copy an existing file onto the Solaris host (assume the file name to be foo.cpp). To compile the file foo.cpp type at the command prompt: $ c++ foo.txt <enter> If the code is without errors, the prompt will disappear for a brief instant indicating a program running in the foreground and then reappear without comments. What has happened is that the compiler compiled the source code into an executable named a.out into your current directory. To execute the code, type at the command prompt $ ./a.out <enter> (note thats a: dot, slash, the character a, dot, and the word out ). The program output will be displayed on the screen. The following screen capture shows the commands and outputs.