Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

help needed for char to char * problem

hi,
i am a beginner to c++ programming and needing some help to solve this problem as i keep getting the following error:-

'strcpy' : cannot convert parameter 1 from 'char' to 'char *'

my code is:-

HANDLE hMappingIn = CreateFileMapping( (HANDLE) 0xffffffffffffffff, 0, PAGE_READWRITE, 0, 4096, "sp0506imess");
assert(hMappingIn !=0);


char * pSharedVirtualMemoryStartAddress = (char*) MapViewOfFile(hMappingIn, FILE_MAP_WRITE,0, 0,0 );
assert(pSharedVirtualMemoryStartAddress);

strcpy(*pSharedVirtualMemoryStartAddress, "string to go in here"); //this is where the error is.

i would be very grateful for any help, thanks in advance!
[743 byte] By [Scudeto] at [2007-11-11 8:13:56]
# 1 Re: help needed for char to char * problem
remove the asterisk before pSharedVirtualMemoryStartAddress:

strcpy(pSharedVirtualMemoryStartAddress, "string to go in here");
Danny at 2007-11-11 21:01:37 >
# 2 Re: help needed for char to char * problem
thanks thats it working
Scudeto at 2007-11-11 21:02:32 >