All pages

All pages of cppreloaded

Item Extract Created Updated
lesson_10_addvalue_c [user02@FC4 Lesson10]$ cat -n addvalue.c 1 #include 2 3 int add_values(int a, int b) 4 { 5 return(a+b); 6 } 7 8 int main(void) 9 { 10 printf("100 + 200 = %d\n", add_values(100, 200) 6 years ago (8/18/05 6:10 AM) rescued_by_c 6 years ago (8/18/05 6:10 AM) rescued_by_c
lesson_10_addvalue_cpp [user02@FC4 Lesson10]$ cat -n addvalue.cpp 1 #include 2 using namespace std; 3 4 int add_values(int a, int b) 5 { 6 return(a+b); 7 } 8 9 int main() 10 { 11 cout << "100 + 200 = 6 years ago (8/18/05 6:05 AM) rescued_by_c 6 years ago (8/18/05 6:05 AM) rescued_by_c
lesson_10_bigsmall_c [user02@FC4 Lesson10]$ cat -n bigsmall.c 1 #include 2 3 void show_big_and_little(int a, int b, int c) 4 { 5 int small = a; 6 int big = a; 7 8 if (b > big) 9 big = b; 10 6 years ago (8/18/05 6:09 AM) rescued_by_c 6 years ago (8/18/05 6:09 AM) rescued_by_c
lesson_10_bigsmall_cpp [user02@FC4 Lesson10]$ cat -n bigsmall.cpp 1 #include 2 using namespace std; 3 4 void show_big_and_little(int a, int b, int c) 5 { 6 int small = a; 7 int big = a; 8 9 if (b > big) 6 years ago (8/18/05 6:04 AM) rescued_by_c 6 years ago (8/18/05 6:04 AM) rescued_by_c
lesson_10_getave_c [user02@FC4 Lesson10]$ cat -n getave.c 1 #include 2 3 float average_value(int a, int b) 4 { 5 return((a + b) / 2.0); 6 } 7 8 int main(void) 9 { 10 printf("The average value is: %f\ 6 years ago (8/18/05 6:11 AM) rescued_by_c 6 years ago (8/18/05 6:11 AM) rescued_by_c
lesson_10_getave_cpp [user02@FC4 Lesson10]$ cat -n getave.cpp 1 #include 2 using namespace std; 3 4 float average_value(int a, int b) 5 { 6 return((a + b) / 2.0); 7 } 8 9 int main() 10 { 11 cout << 6 years ago (8/18/05 6:05 AM) rescued_by_c 6 years ago (8/18/05 6:05 AM) rescued_by_c
lesson_10_proto_c [user02@FC4 Lesson10]$ cat -n proto.c 1 #include 2 3 float average_value(int, int); // Function prototype 4 5 int main(void) 6 { 7 printf("The average of 2000 and 2 is %f\n", average_value(2000, 2)); 6 years ago (8/18/05 6:12 AM) rescued_by_c 6 years ago (8/18/05 6:12 AM) rescued_by_c
lesson_10_proto_cpp [user02@FC4 Lesson10]$ cat -n proto.cpp 1 #include 2 using namespace std; 3 4 float average_value(int, int); // Function prototype 5 6 int main() 7 { 8 cout << "The average of 2000 and 2 is " << 6 years ago (8/18/05 6:06 AM) rescued_by_c 6 years ago (8/18/05 6:06 AM) rescued_by_c
lesson_10_show_emp_c [user02@FC4 Lesson10]$ cat -n show_emp.c 1 #include 2 3 void show_employee(int age, float salary) 4 { 5 printf("The employee is %d years old\n", age); 6 printf("The employee makes $%f\n", salary); 7 6 years ago (8/18/05 6:10 AM) rescued_by_c 6 years ago (8/18/05 6:10 AM) rescued_by_c
lesson_10_show_emp_cpp [user02@FC4 Lesson10]$ cat -n show_emp.cpp 1 #include 2 using namespace std; 3 4 void show_employee(int age, float salary) 5 { 6 cout << "The employee is " << age << " years old" << endl; 7 cout << 6 years ago (8/18/05 6:05 AM) rescued_by_c 6 years ago (8/18/05 6:05 AM) rescued_by_c
lesson_10_show_msg_c [user02@FC4 Lesson10]$ cat -n show_msg.c 1 #include 2 3 void show_message(void) 4 { 5 printf("Hello, I've been Rescued by C\n"); 6 } 7 8 int main(void) 9 { 10 printf("About to call 6 years ago (8/18/05 6:07 AM) rescued_by_c 6 years ago (8/18/05 6:07 AM) rescued_by_c
lesson_10_show_msg_cpp [user02@FC4 Lesson10]$ cat -n show_msg.cpp 1 #include 2 using namespace std; 3 4 void show_message() 5 { 6 cout << "Hello, I've been Rescued by C++" << endl; 7 } 8 9 int main() 10 { 6 years ago (8/18/05 6:03 AM) rescued_by_c 6 years ago (8/18/05 6:03 AM) rescued_by_c
lesson_10_two_msgs_c [user02@FC4 Lesson10]$ cat -n two_msgs.c 1 #include 2 3 void show_title(void) 4 { 5 printf("Book: Rescued by C\n"); 6 } 7 8 void show_lesson(void) 9 { 10 printf("Lesson: Getting Sta 6 years ago (8/18/05 6:08 AM) rescued_by_c 6 years ago (8/18/05 6:08 AM) rescued_by_c
lesson_10_two_msgs_cpp [user02@FC4 Lesson10]$ cat -n two_msgs.cpp 1 #include 2 using namespace std; 3 4 void show_title() 5 { 6 cout << "Book: Rescued by C++" << endl; 7 } 8 9 void show_lesson() 10 { 11 6 years ago (8/18/05 6:04 AM) rescued_by_c 6 years ago (8/18/05 6:04 AM) rescued_by_c
lesson_10_useparam_c [user02@FC4 Lesson10]$ cat -n useparam.c 1 #include 2 3 void show_number(int value) 4 { 5 printf("The parameter's value is %d\n", value); 6 } 7 8 int main(void) 9 { 10 show_number(1 6 years ago (8/18/05 6:09 AM) rescued_by_c 6 years ago (8/18/05 6:09 AM) rescued_by_c
lesson_10_useparam_cpp [user02@FC4 Lesson10]$ cat -n useparam.cpp 1 #include 2 using namespace std; 3 4 void show_number(int value) 5 { 6 cout << "The parameter's value is " << value << endl; 7 } 8 9 int main() 6 years ago (8/18/05 6:04 AM) rescued_by_c 6 years ago (8/18/05 6:04 AM) rescued_by_c
lesson_11_chgparam_c [user02@FC4 Lesson11]$ cat -n chgparam.c 1 #include 2 3 void change_values(int *a, int *b) 4 { 5 *a = 1001; 6 *b = 1001; 7 8 printf("The values within display_values are %d and %d\n", *a, * 6 years ago (8/18/05 6:54 AM) rescued_by_c 6 years ago (8/18/05 6:54 AM) rescued_by_c
lesson_11_chgparam_cpp [user02@FC4 Lesson11]$ cat -n chgparam.cpp 1 #include 2 using namespace std; 3 4 void change_values(int *a, int *b) 5 { 6 *a = 1001; 7 *b = 1001; 8 9 cout << "The values within displ 6 years ago (8/18/05 6:52 AM) rescued_by_c 6 years ago (8/18/05 6:52 AM) rescued_by_c
lesson_11_nochange_c [user02@FC4 Lesson11]$ cat -n nochange.c 1 #include 2 3 void display_values(int a, int b) 4 { 5 a = 1001; 6 b = 1001; 7 8 printf("The values within display_values are %d and %d\n", a, b); 6 years ago (8/18/05 6:53 AM) rescued_by_c 6 years ago (8/18/05 6:53 AM) rescued_by_c
lesson_11_nochange_cpp [user02@FC4 Lesson11]$ cat -n nochange.cpp 1 #include 2 using namespace std; 3 4 void display_values(int a, int b) 5 { 6 a = 1001; 7 b = 1001; 8 9 cout << "The values within display_ 6 years ago (8/18/05 6:51 AM) rescued_by_c 6 years ago (8/18/05 6:51 AM) rescued_by_c
lesson_11_swapvals_c [user02@FC4 Lesson11]$ cat -n swapvals.c 1 #include 2 3 void swap_values(float *a, float *b) 4 { 5 float temp; 6 7 temp = *a; 8 *a = *b; 9 *b = temp; 10 } 11 12 int ma 6 years ago (8/18/05 6:54 AM) rescued_by_c 6 years ago (8/18/05 6:54 AM) rescued_by_c
lesson_11_swapvals_cpp [user02@FC4 Lesson11]$ cat -n swapvals.cpp 1 #include 2 using namespace std; 3 4 void swap_values(float *a, float *b) 5 { 6 float temp; 7 8 temp = *a; 9 *a = *b; 10 *b = temp 6 years ago (1/6/06 11:33 AM) Anonymous 6 years ago (1/6/06 11:33 AM) Anonymous
lesson_12_showtime_c [user02@FC4 Lesson12]$ cat -n showtime.c 1 #include 2 #include // For run-time library functions 3 4 int main(void) 5 { 6 time_t system_time; 7 8 system_time = time(NULL); 9 6 years ago (8/18/05 7:08 AM) rescued_by_c 6 years ago (8/18/05 7:08 AM) rescued_by_c
lesson_12_showtime_cpp [user02@FC4 Lesson12]$ cat -n showtime.cpp 1 #include 2 #include // For run-time library functions 3 using namespace std; 4 5 int main() 6 { 7 time_t system_time; 8 9 syste 6 years ago (8/18/05 6:59 AM) rescued_by_c 6 years ago (8/18/05 6:59 AM) rescued_by_c
lesson_12_sqrt_c [user02@FC4 Lesson12]$ cat -n sqrt.c 1 #include 2 #include // Contains sqrt prototype 3 4 int main(void) 5 { 6 printf("The square root of 100.0 is %f\n", sqrt(100.0)); 7 printf("The 6 years ago (8/18/05 7:08 AM) rescued_by_c 6 years ago (8/18/05 7:08 AM) rescued_by_c
lesson_12_sqrt_cpp [user02@FC4 Lesson12]$ cat -n sqrt.cpp 1 #include 2 #include // Contains sqrt prototype 3 using namespace std; 4 5 int main() 6 { 7 cout << "The square root of 100.0 is " << sqrt(100.0 6 years ago (8/18/05 7:00 AM) rescued_by_c 6 years ago (8/18/05 7:00 AM) rescued_by_c
lesson_12_syscall_c [user02@FC4 Lesson12]$ cat -n syscall.c 1 #include 2 3 int main(void) 4 { 5 system("ls"); 6 7 return 0; 8 } [user02@FC4 Lesson12]$ gcc -o syscall syscall.c [user02@FC4 Lesson12]$ ./syscall bc 6 years ago (8/18/05 7:09 AM) rescued_by_c 6 years ago (8/18/05 7:09 AM) rescued_by_c
lesson_12_syscall_cpp [user02@FC4 Lesson12]$ cat -n syscall.cpp 1 #include 2 3 int main() 4 { 5 system("ls"); 6 7 return 0; 8 } [user02@FC4 Lesson12]$ g++ -o syscall syscall.cpp [user02@FC4 Lesson12]$ ./syscall a. 6 years ago (8/18/05 7:00 AM) rescued_by_c 6 years ago (8/18/05 7:00 AM) rescued_by_c
lesson_13_global_c [user02@FC4 Lesson13]$ cat -n global.c 1 #include 2 3 int number = 1001; 4 5 void first_change(void) 6 { 7 printf("number's value in first_change %d\n", number); 8 ++number; 9 } 10 6 years ago (8/18/05 7:13 AM) rescued_by_c 6 years ago (8/18/05 7:13 AM) rescued_by_c
lesson_13_global_cpp [user02@FC4 Lesson13]$ cat -n global.cpp 1 #include 2 using namespace std; 3 4 int number = 1001; 5 6 void first_change() 7 { 8 cout << "number's value in first_change " << number << endl; 6 years ago (8/18/05 7:11 AM) rescued_by_c 6 years ago (8/18/05 7:11 AM) rescued_by_c