Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show.

Similar presentations


Presentation on theme: "Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show."— Presentation transcript:

1 Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show me the result after you finish all the tasks. Make-Up Policies: If you cannot finish the drill in the lab, you can go back to work on it. You can send me (including result screenshot and source code) or show me in next lab.

2 Drill Task: Do Drill 1 on page 297 at the end of chapter 8. You can also read following instructions: - Create three files: my.h, my.cpp and use.cpp. The header file my.h contains extern int foo; void print_foo(); void print(int);

3 Drill The source code file my.cpp #includes my.h and std_lib_facilities_4.h, defines print_foo() to print the value of foo using cout, and print(int i) to print the value of i using cout. The source code file use.cpp #includes my.h, defines main() to set the value of foo to 7 and print it using print_foo(), and to print the value of 99 using print(). Note that use.cpp does not #include std_lib_vacilities_4.h as it doesn’t directly use any of those facilities

4 Drill - Get these files compiled and run. On Windows, you need to have both use.cpp and my.cpp in a project and use {char cc; cin>>cc;} in use.cpp to be able see your output. Hint: You need to #include <iostream> to use cin.


Download ppt "Lab 8 Instructions You can use g++ on build server, visual studio on local machine or your preferred C++ IDE. Important Note: For your grade, please show."

Similar presentations


Ads by Google