Hey friends, I am new to C++, much appreciate your help on this issue. In the following code, I would like to pass a delimiter (say '\t') as a command line argument. When I parse the delimiter as below, I get a segmentation fault.
Replacing assign(argv[1]) with assign("\t") works fine. Could you please let me know the easiest way to resolve my issue? I wanted to receive the delimiter from the command line argument and use it in is_any_of(). I have tried various combinations shown below as command line but nothing helped.
./a.out '\t'
./a.out \t
./a.out \\t (parses as \t but doesn't work)
./a.out \\\t
I haven't check it but shouldn't your argument be ./a.out \t instead of ./a.out "\t"?
I mean arguments are passed as strings so you are passing a ""\t"", right?