2022-04-21 18:32:17 -05:00
|
|
|
|
2021-09-05 11:58:58 -05:00
|
|
|
#include <string>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
2023-10-21 12:43:42 -05:00
|
|
|
// argc == number of arguments passed to the program.
|
|
|
|
|
// argv == argument array.
|
|
|
|
|
// j == some misc integer.
|
|
|
|
|
// i == loop counter for printing arguments.
|
|
|
|
|
// message == say hi to the world.
|
|
|
|
|
// function1 == a function to call to simulate work.
|
|
|
|
|
|
2024-11-10 12:40:43 -06:00
|
|
|
void function1 (const std::string& message);
|
|
|
|
|
int valueoflife ();
|
2021-09-05 11:58:58 -05:00
|
|
|
|
|
|
|
|
int main (int argc, char** argv) {
|
|
|
|
|
|
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<argc; i++) {
|
2022-11-01 11:33:03 -05:00
|
|
|
std::cout << "XX: "
|
|
|
|
|
<< i
|
|
|
|
|
<< " "
|
|
|
|
|
<< argv[i]
|
|
|
|
|
<< std::endl;
|
2021-09-05 11:58:58 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string message = "Hello, World!";
|
|
|
|
|
|
|
|
|
|
j++;
|
|
|
|
|
|
|
|
|
|
function1(message);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|