Commit 4a3b890a authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+5 −0
Changes for Beginning C++ Programming - Working Files/Working Files - README.txt: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
Due to ongoing efforts to ensure you have the best possible learning experience, we may update the working files for this course from time to time.

We recommend that you download the latest version of these files from:

http://www.infiniteskills.com/02228
 No newline at end of file
+6 −0
Changes for Beginning C++ Programming - Working Files/source_code/chap-01/new-project/src/hello_world.cpp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line

#include <iostream>

int main() {
	std::cout << "Hello world!" << std::endl;
}
+16 −0
Changes for Beginning C++ Programming - Working Files/source_code/chap-02/cmd-args/src/main.cpp: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line

#include <iostream>

int main(int argc, char* argv[]) {

	if (argc < 6) {
		std::cerr << "Error! Invalid number of arguments. Must be at least 5." << std::endl;
		return 1;
	}

	std::cout << "Total arguments: " << argc << std::endl;
	for (int i = 0; i < argc; ++i) {
		std::cout << "argv[" << i << "] = " << argv[i] << std::endl;
	}
}
+14 −0
Changes for Beginning C++ Programming - Working Files/source_code/chap-02/hello-world/main.cpp: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line

#include <iostream>
#include <string>

constexpr auto greeting = "hello world!";
auto fx = [] (auto msg) { return std::string("hello ") + msg; };

int main() {

    std::cout << greeting << std::endl;
    std::cout << fx("John") << std::endl;

}
Loading