I have a string and i want to copy at specified memory location.
Suppose i have a pre-allocated memory represented by

char* logFile (unsafe code)

I have a generated string which contains the name of log file.
I want to copy that string on location represented by char*.

Please help me on this.

Also i have to copy specified number of characters from a given location
to specified location.

The code in delphi looks something like:

StrLCopy(msg, PChar(gsRootErrorMsg), MAX_ERR_MESSAGE);
where msg is character pointer:msg: PChar
and gsRootErrorMsg is string.

Help would be really appreciated.

Try this,

static void Main(string[] args)
                string str = "Hello World";
                char* pstr=stackalloc char[str.Length + 1];

                int i = 0;
                    *(pstr + i) = str[i];

                *(pstr+i) = '\u0000';

                while (*pstr != '\u0000')

Perfect ..
It worked ..

Now second thing is that i need to copy the contents from a specified memory location (source) to specified memory location (destination) upto specified Max number of characters.

Help would be really appreciated.

Not so difficult,