Firstly, your trying to return a char* here, not a char. There is a big difference.
problem 1: In c++ arrays are passed to functions as pointers, so str1 is a char* and thus sizeof(str1) = 4. Note that sizeof(str2) is 256 as you would expect.
problem 2: char array str2 is a local variable. It exists in this function and it will not exist when the function ends (that is, its used memory will be reused). What you should do is use dynamic memory (see the tutorial, if you haven't). However then in this code, you'll have no way of deleting it. You should (always if possible) use std::string to take care of the memory management (see the reference).
and i have question, what is diffrence with char and char*?
A char is a data type used to represent a single character.
A char* is a pointer. It is just a number. The number is the number of somewhere in memory.
You need to go back to basics and learn the basic types; int, char, double, int*, double*, and so on. If you do not know the difference between basic types, you will never get anywhere.
char* a = kucuk("hello");
char* b = kucuk("world");
std::cout << a << " " << b;
- here you'll get "world world". That's because since str2 is static, every time you call kucuk, the same memory will be used and thus new words will overwrite the old ones.