请教:ACE_Mem_Map
我写了一个程序是用内存映射类:ACE_Mem_Map 但提示有问题,请教哪位高手能帮解决:程序如下:#include "ace/Log_Msg.h"
//#include "ace/SOCK_Dgram_Bcast.h"
//#include "ace/Addr.h"
#include <ace/Mem_Map.h>
static void putline( ACE_TCHAR *s)
{
while(putchar(*s++)!= '\n')
continue;
}
int ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
ACE_TCHAR *filename = argv;
ACE_TCHAR *file_p;
ACE_Mem_Map mmap(filename);
if(mmap(file_p)!=-1)
{
size_t size = mmap.size()-1;
if(file_p =='\0')
file_p ='\n';
while(--size >= 0)
if(file_p =='\n')
putline(file_p+size+1);
putline(file_p);
return 0; }
else
return 1;
}
提示错误为在 if(mmap(file_p)!=-1)中错误为:error C2664: '()' : cannot convert parameter 1 from 'char *' to 'void *& '
A reference that is not to 'const' cannot be bound to a non-lvalue我应该如何改正才可运行,顺便请教下ACE_Mem_Map 的用法的,谢谢! 这里应该写成mmap( (void *&)file_p );
页:
[1]