Question: I know that when passing strings between functions

char \*str is almost the same as char str[n] in function header.

However i do wanna know why this would work and whats the difference between these 2 when working with string

I found that if i declare a "char \*in" first then assign a string to it "in=string;" 
this wont work

can some one tell me whats behind this?

Is there anyway I can assign a array to another array? like in Java

Thanks 

```
char[] one;
char[] two={'a','b'};
one=two;

```

Answer: 
```
char[] one;

```

The syntax is wrong. This isn't Java. 

```
char* one;
char two[]={'a','b'};
one = two;

```

This works because array decays to a pointer.

> 
> "char \*str is almost the same as char str[n] in function header."
> 
> 
> 

**NO**. Arrays and pointers are two different concepts. They both aren't the same.
The best explanation I've seen for the relationship between arrays and pointers in C (and C++) is section 6 of the [comp.lang.c FAQ](http://c-faq.com).