mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
docs: call_v_from_c example (#15844)
This commit is contained in:
@@ -115,6 +115,7 @@ To do so, run the command `v up`.
|
||||
* [sizeof and __offsetof](#sizeof-and-__offsetof)
|
||||
* [Calling C from V](#calling-c-from-v)
|
||||
* [Calling V from C](#calling-v-from-c)
|
||||
* [Export to shared library](#export-to-shared-library)
|
||||
* [Atomics](#atomics)
|
||||
* [Global Variables](#global-variables)
|
||||
* [Debugging](#debugging)
|
||||
@@ -5007,7 +5008,13 @@ fn main() {
|
||||
|
||||
## Calling V from C
|
||||
|
||||
Since V can compile to C, calling V code from C is very easy.
|
||||
Since V can compile to C, calling V code from C is very easy, once you know how.
|
||||
|
||||
Use `v -o file.c your_file.v` to generate a C file, corresponding to the V code.
|
||||
|
||||
More details in [call_v_from_c example](../examples/call_v_from_c).
|
||||
|
||||
## Export to shared library
|
||||
|
||||
By default all V functions have the following naming scheme in C: `[module name]__[fn_name]`.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user