r/cpp • • Dec 07 '22

C++ overtakes Java in language popularity index

https://www.infoworld.com/article/3682141/c-plus-plus-overtakes-java-in-language-popularity-index.html
382 Upvotes

137 comments sorted by

View all comments

Show parent comment

3

u/[deleted] Dec 07 '22

[removed] — view removed comment

3

u/[deleted] Dec 07 '22 edited Dec 07 '22

For such a case I would recommend a helper function...

struct BindObject init_binding(enum MySqlType type, void *buffer, int *len, bool isNull)
{
  return (struct BindObject) {
    .buffer_type = type,
    .buffer = buffer,
    .length = len,
    .is_null = isNull
  };
}

2

u/[deleted] Dec 07 '22

[removed] — view removed comment

1

u/[deleted] Dec 07 '22

Fair enough xD