Hi,
I want to check if a device is mounted before performing actual mount. I was able to check that using the below C code. But in C++ it is throwing the following error:
" error: invalid conversion from `int' to `const char*' "
C program just generated a warning message, but C++ throws error..
Please let me know if there is any other way to find the mount devices using C++.
int main()
{
if (system('mount | grep "home" >/dev/null') != 0)
printf("home is mounted\n");
else
printf("home is not mounted\n");
}