xxx
Computer Terminal Output
Computer terminal output is usually taken directly from a computer terminal presented
in a monospaced font such as the following example demonstrating cloning the
Persistent Memory Development Kit (PMDK) from the GitHub project:
$ git clone https://github.com/pmem/pmdk
Cloning into 'pmdk'...
remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 100169 (delta 2), reused 7 (delta 2), pack-reused 100157
Receiving objects: 100% (100169/100169), 34.71 MiB | 4.85 MiB/s, done.
Resolving deltas: 100% (83447/83447), done.
Source Code
Source code examples taken from the accompanying GitHub repository are shown with
relevant line numbers in a monospaced font. Below each code listing is a reference to
the line number or line number range with a brief description. Code comments use
language native styling. Most languages use the same syntax. Single line comments
will use // and block/multiline comments should use /*..*/. An example is shown in
Listing 1.
Listing 1. A sample program using libpmemkv
37 #include
38 #include "libpmemkv.h"
39
40 using namespace pmemkv;
41
42 /*
43 * kvprint -- print a single key-value pair
44 */
45 void kvprint(const string& k, const string& v) {
46
std::cout << "key: " << k << ", value: " << v << "\n";
47 }
PrefaCe
Précédent

- 28/457

Suivant