Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Passing JSON as parameter #467

Closed
ghost opened this issue Jul 15, 2020 · 2 comments
Closed

Passing JSON as parameter #467

ghost opened this issue Jul 15, 2020 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 15, 2020

I'm developing a C++ application that uses nlohmann::json API.
Link here: https://github.com/nlohmann/json

I would like to call a Fortran function passing a JSON as a input argument.

extern "C" {
    void my_fortran_fun(nlohmann::json myJson);
}

int main() 
{
...
    my_fortran_fun(my_json);
---
}

Is it possible?

@jacobwilliams
Copy link
Owner

JSON-Fortran isn't going to understand the C++ structure (and C++ isn't going to understand the Fortran structure). Probably you could do it by serializing the JSON to a string?

@jacobwilliams
Copy link
Owner

See also #371 and #429.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant