Examples of C/C++ code blocks in noweb
:PROPERTIES: :PRJ-DIR: ./2023-10-05-noweb-C/:
Examples
Simple example
Blah blah
#include <iostream>
int main (void)
{
std::cout << "Hello World" << std::endl;
}
Using variables
#include <iostream>
int main (void)
{
std::cout << a+b << std::endl;
}
Using array variables
#include <iostream>
int main (void)
{
std::cout << a+b[1] << std::endl;
}
Using noweb parameters in another noweb block
-
Elisp example
(+ x x) (+ x 2) 10 12
-
ABANDONED C/C++ example
-
A
#include <iostream> int fun1(int a, int b) { return a+b ; } int main(){ int a = fun1(x,y) ; std::cout <<a<<std::endl ; return a; }
-
B
int fun1(int a, int b) { return a+b ; } #include <iostream> int fun1(int a, int b) { return a+b ; } int main(){ int a = fun1(x,y) ; std::cout <<a<<std::endl ; return a; } 12 (+ x 2) 10 12
-
-
Some test
debian lenovo trackpoint scroll