This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Project1.cpp g++ compiler text files Creating and Compiling a C++ Program
STEP 3: You then use the OS to start the g++ compiler, another machine code executable
machine code files You (the user) The computer OS text editor Project1.cpp g++ compiler text files Creating and Compiling a C++ Program
STEP 4: g++ then translates Project1.cpp to a machine language executable called Project1
machine code files You (the user) The computer OS text editor Project1.cpp g++ compiler Project1 text files Creating and Compiling a C++ Program
STEP 5: Using the OS you can then run the new executable that g++ created, it may create files
machine code files You (the user) The computer OS text editor Project1.cpp g++ compiler fakefile.dat Project1 text files The command to compile a C++ program is: g++ mycode.cpp –o myexec Creating and Compiling Creating and Compiling a C++ Program Here mycode.cpp is the name of the text file containing your program and myexec is the resulting machine language executable. You can then execute the new program by typing: myexec Recap Recap All algorithms consist of sequence, iteration and selection. In order to make an algorithm into a program it must be written in a programming language. C++ programs are composed of declarations and expressions plus scaffolding. A C++ program must be compiled before it can be executed. News Flash! Machines Powered by Heart Muscles Pumps Walkers Swimmers http://www.technologyreview.com/Biotech/19352/ News Flash! News Flash! Pumps See link “A curled triangular piece of plastic walks across the bottom of a petri dish as muscle tissue repeatedly contracts” “Another triangular sheet, with a different arrangement of heartmuscle cells, mimics the movement of a fish's tail to swim” Walkers Swimmers News Flash! News Flash! Muscle is made to grow on the plastic using protein “cues” that dictate alignment Muscles currently only survive for a few weeks, so improvements need to be made Other articles: iBody article in New Scientist M...
View Full Document
This note was uploaded on 03/12/2010 for the course ENGIN 101 taught by Professor Jeffringenberg during the Fall '07 term at University of Michigan.
- Fall '07