emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* evaluate cpp snippet in org babel with default includes and customized entry point
@ 2017-09-16  7:50 Amos Bird
  2017-09-16  8:33 ` Thierry Banel
  2017-09-16  8:46 ` Thierry Banel
  0 siblings, 2 replies; 10+ messages in thread
From: Amos Bird @ 2017-09-16  7:50 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

#+OPTIONS: latex:t toc:nil H:3

Hi

I'd like to write a blog about leetcode solutions in c++. How can I evaluate those c++ code snippet using org babel?

* Array

** Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

Example:
Given nums = [2, 7, 11, 15], target = 9,

Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].


#+BEGIN_SRC cpp
class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {

    }
};
#+END_SRC

#+RESULTS:


I need to add default headers and pass arguments to the entry class.

--
Amos Bird
amosbird@gmail.com

[-- Attachment #2.1: Type: text/html, Size: 2212 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-09-16  9:37 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-16  7:50 evaluate cpp snippet in org babel with default includes and customized entry point Amos Bird
2017-09-16  8:33 ` Thierry Banel
2017-09-16  8:37   ` Amos Bird
2017-09-16  8:54     ` Thierry Banel
2017-09-16  8:58       ` Amos Bird
2017-09-16  9:11         ` Thierry Banel
2017-09-16  9:14           ` Amos Bird
2017-09-16  9:36             ` Thierry Banel
2017-09-16  9:05       ` Thierry Banel
2017-09-16  8:46 ` Thierry Banel

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).