# Declaring Strings In C

**URL:** <https://forum.devtalk.com/t/declaring-strings-in-c/102333>\
**Category:** Backend Questions/Help\
**Tags:** c\
**Created:** [26 March 2023 04:31 UTC](https://forum.devtalk.com/t/declaring-strings-in-c/102333 "2023-03-26T04:31:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![harwind](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/h/c77e96/32.png) [@harwind](https://forum.devtalk.com/u/harwind)\
**Post date:** [26 March 2023 04:31 UTC](https://forum.devtalk.com/t/declaring-strings-in-c/102333/1 "2023-03-26T04:31:45Z")

</div>

In C, how they are different?

```auto
char str[] = "xyz"; // statement 

//and 

char str[4] = "xyz"; // statement 

```

The first, in my understanding, assigns a pointer to a string literal, whereas the second is a four-character character array (including the NULL character).

So how are these two preserved in memory if this is the case?
