I am trying to make a program that uses one *scansf* function to get someones entire name at once and stores each letter in one layer of an array. 
For example what it should do if the name entered is "tim":

```
 array[0]=t
 array[1]=i
 array[2]=m
 array[3]=\0

```

i have read this in other threats but it doesn´t work:

```
#include <stdio.h>

int main(void) {
    char array[256];
    scanf_s("%s", array);
    printf_s("%s", array);
    return 0;
}

```

It gives out this error message:

[![enter image description here](https://i.stack.imgur.com/ubv96.png)](https://i.stack.imgur.com/ubv96.png)

> 
> English:  
> 
>  Exeption triggered at 0x0FAA0B5C   
> 
>  access violation while writing position 0x01300000
> 
> 
> 

Is it even possible to use the *scanf* function if yes how?
Or is there a better alternative?

---

Thank you by adding the buffer parameter **works**  

code:

```
#include <stdio.h>
#include "stdafx.h"

int main(void) {
    char array[256];
    scanf_s("%255s", array, 256);
    printf("%s", array);
    return 0;
}

```