Quot " in a (char *)

Hello, I have a problem, quoting a char array. I have this string

-m file.dat -if "eth0" -s switch_on

And I need that pointed by an const char*, therefore:

const char *t_argv = "-m file.dat -if "eth0" -s switch_on";, as you can see I have quotation marks (") in my string itself. I tried to quote this via:
const char *t_argv = "-m file.dat -if \"eth0\" -s switch_on";
but It won't work properly. Hoew do I quote the " sign properly?

I appreaciate any hints.
Cheers Huck

Your code works fine.

1
2
3
4
5
6
7
8
#include <iostream>
int main()
{
  const char *t_argv = "-m file.dat -if \"eth0\" -s switch_on";
 
  std::cout << t_argv;
  return 0;
}


http://ideone.com/tIc4G
Topic archived. No new replies allowed.