emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob 4721c962c2d89c382f3fe09daa6a526372ffad80 1000 bytes (raw)
name: testing/examples/ob-C-test.org 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
#+Title: a collection of examples for ob-C tests
#+OPTIONS: ^:nil
* Simple tests
  :PROPERTIES:
  :ID:       fa6db330-e960-4ea2-ac67-94bb845b8577
  :END:
#+source: simple
#+begin_src cpp :includes "<iostream>" :results silent
  std::cout << 42;
  return 0;
#+end_src 

#+source: integer_var
#+begin_src cpp :var q=12 :includes "<iostream>" :results silent
  std::cout << q;
  return 0;
#+end_src

#+source: two_var
#+begin_src cpp :var q=12 :var p=10 :includes "<iostream>" :results silent
  std::cout << p+q;
  return 0;
#+end_src

#+source: string_var
#+begin_src cpp :var q="word" :includes '(<iostream> <cstring>) :results silent
  std::cout << q << ' ' << strlen(q);
  return 0;
#+end_src

#+source: define
#+begin_src cpp :defines N 42  :includes "<iostream>" :results silent
  std::cout << N;
  return 0;
#+end_src

* Array
#+source: array
#+begin_src cpp :includes "<iostream>" :results vector :results silent
  for (int i=1; i<3; i++) {
    std::cout << i << '\n';
  }
  return 0;
#+end_src

debug log:

solving 4721c96 ...
found 4721c96 in https://git.savannah.gnu.org/cgit/emacs/org-mode.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).