# C types interchangeability with Julia types

**URL:** <https://discourse.julialang.org/t/c-types-interchangeability-with-julia-types/42083>\
**Category:** General Usage\
**Created:** [June 26, 2020, 12:26am UTC](https://discourse.julialang.org/t/c-types-interchangeability-with-julia-types/42083 "2020-06-26T00:26:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [June 26, 2020, 12:26am UTC](https://discourse.julialang.org/t/c-types-interchangeability-with-julia-types/42083/1 "2020-06-26T00:26:02Z")

</div>

I wrote a wrapper of C library. Here is one of C functions:

```julia
extern "C" bool start(char* nodeName)

```

and Julia equivalent:

```julia
export start

function start(nodeName::String)
  ccall((:start, "libsimc.so"), Bool, (Cstring,), nodeName)   
end

```

Rereading the manual, I noticed that `ccall` should really be written as:

```julia
ccall((:start, "libsimc.so"), Cuchar, (Cstring,), nodeName) 

```

i.e. `Cuchar` instead of `Bool`. `Cuchar` and `Bool` are both represented by one byte, but the types seem to be unrelated. Was I just lucky that my implementation seemed to work?
