# Best practices for passing C strings

**URL:** <https://fortran-lang.discourse.group/t/best-practices-for-passing-c-strings/104>\
**Category:** Uncategorized\
**Created:** [June 8, 2020, 3:37pm UTC](https://fortran-lang.discourse.group/t/best-practices-for-passing-c-strings/104 "2020-06-08T15:37:24Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![ivanpribec](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/ivanpribec/32/3290_2.png) [@ivanpribec](https://fortran-lang.discourse.group/u/ivanpribec)\
**Post date:** [June 10, 2020, 8:15pm UTC](https://fortran-lang.discourse.group/t/best-practices-for-passing-c-strings/104/14 "2020-06-10T20:15:53Z")

</div>

The way I understand it, it is just convenience. According to the proposal the default behavior is to trim, giving the clean syntax `f_c_string(string)`. If you don’t want to trim, you would do `f_c_string(string,trim=.false.)`. I leave it to @sblionel to correct me if I am wrong.

Edit: corrected the name to `f_c_string`.

---

_[View the full topic](https://fortran-lang.discourse.group/t/best-practices-for-passing-c-strings/104)._
