|
From: | Amos Bird |
Subject: | Re: [O] evaluate cpp snippet in org babel with default includes and customized entry point |
Date: | Sat, 16 Sep 2017 16:58:57 +0800 |
User-agent: | mu4e 0.9.19; emacs 25.3.1 |
Ok, i get the idea. So how can I customized the default code expansion so that it can directly evaluate this
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
}
};
Thierry Banel <address@hidden> writes:
> You may use the :includes header parameter.
>
> Also, you may omit the main() function. In this case, all your code will become
> the body of a default main function. Type C-c C-v v on the following example to
> understand what is happening.
>
>
> #+BEGINSRC C++ :includes <iostream>
> std::cout<<"hello";
> #+ENDSRC
>
> #+RESULTS:
> : hello
>
>
> On 16/09/2017 10:37, Amos Bird wrote:
>>
>> Thanks Thierry,
>>
>> But I'd like to hide all those includes and the main function. I'm not sure if
>> it's possible.
>>
>>
–
Amos Bird
address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |