0

I'm trying to write some data to a file in Mosync. This is what I'm doing:

String filename = "c:\\hamburger.txt";
MAHandle newfile = maFileOpen (&filename, MA_ACCESS_READ_WRITE);
maFileCreate (newfile);
maFileWrite (newfile, &keyCode, 1);

The error occurs at line 2,

MAHandle newfile = maFileOpen (&filename, MA_ACCESS_READ_WRITE); 

when trying to open the address at &filename. It says it can't convert a MAUtil::String to a const char*.

JVE999
  • 3,327
  • 10
  • 54
  • 89

1 Answers1

0

You can convert a MAUtil::String into a const char* with .c_str().

Thus, instead of &filename, I used filename.c_str() and it compiled. The entire code still does not work, however.

JVE999
  • 3,327
  • 10
  • 54
  • 89