Q:

What is equivalent mmap in C++ for linux?

What is equivalent mmap into C++?
I have code like below
LCDdata = mmap(NULL, iFrameBufferSize, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fb_fd, 0);

Where LCDdata is unsigned char type pointer, iFrameBufferSize is int type and fb_fd is static int type.
When I compile it by use of arm g++ tool chain it give me error as below
error: invalid conversion from 'void*' to 'unsigned char*' [-fpermissive]

So how can I use any equivalent type function instead of mmap?
Which header file I should include? And how this new line's syntax will become?

A:

The C++ equivalent is auto LCDdata = static_cast<unsigned char*>(mmap(...
In C++ we prefer to define out variables only when we initialize them, and because of that we often don't need to specify the type anymore. Here, we don't need to repeat unsigned char*.

