There are different ways in which parameter data can be passed into and out of methods and functions. The above should prove obvious that you did not pass a pointer to a C string. Passing Char Array into a function in C - Stack Overflow Passing the full path to the DLL is the safest way to ensure the correct library and dependencies are loaded. In the above example, I listed all working methods I know for passing char pointer to function. where I want it to be initialized. Point to be noted that when you do point = "blah" you are creating a string literal, and any attempt to modify is Undefined behaviour, so it should really be const char *. How to pass the address of structure as an argument to function in C? #include #include char* createStr () { static char str [20] = "my"; return str; } int main () { char a [20]; strcpy (a,createStr ()); //this will copy the returned value of createStr () into a [] printf ("%s",a); The appropriate declaration of p should be const char *p. Parameter Passing Techniques in C/C++ - GeeksforGeeks char *ptr is the character pointer that will store the base address of the character array (string) which is going to be passed through main () function. So. It's pointer to an array, so in fact pointer to pointer, not a pointer to a value. Output. In our first example, we will pass the string to a function that is done for any other ordinary array (i.e., float, integer, or double array). there to pass char array to function in C c