Hi,
I want to convert character[2] into char.
sample code,
char DocType = 0;
char pType[2] = {0};
char pType contains values as 'p','x', 'f' with '\0' as terminated string.
I want to copy only fist character into DocType.
I used strcpy, but its not working because char and char[2] conversion.
So i used strncpy as,
strncpy(DocType , pType,1);
but still I am facing error as,
A parameter of type "char * restrict" cannot be initialized with an expression of type "char".
Please help me out.
Thanks in advance.