Q:

Does C add '\0' when you pass a literal string as an argument in a function?

For instance, if I write:
void function(char *k){ printf("%s",k);}

and call it like this:
function("hello");

does the code translate that string to: "hello\0" ? Or I'm the one who has to add it?

A:

All string literals provide a char[] to an array that contains all of the written characters, followed by a \0. It's length is the length of the string you write, plus 1 (char[6] for "Hello"). More information can be found in the here, where they also use the string "Hello" as an example.
Note that in C (And C++), this character array is not modifiable - doing so is undefined behavior. This is commonly represented with const. However, writing
char[] myarr = "Hello";

Will create a duplicate, and may be modified. myarr will contain \0 and have a size of 6 chars.

A:

From the C11 Standard 
Section 6.4.5 String Literals, Paragraph 6 (p. 71):

In  translation  phase  7,  a  byte  or  code  of  value  zero  is  appended  to  each  multibyte
  character sequence that results from a string literal or literals.
  78)
  The multibyte character
  sequence  is  then  used  to  initialize  an  array  of  static  storage  duration  and  length  just
  sufficient  to  contain  the  sequence

A:

A string literal already includes a terminating \0 by itself, regardless of what you do with that literal. "hello" is always a char [6] array of h, e, l, l, o and \0, by definition. So, the fact that you "pass it to a function" is completely inconsequential here. 
There's no need to add anything.

