0

How to put argv in comma sepearted

*char argv = [one, two, ...] argc = 4 *Segmentation fault https://code.sololearn.com/c1jVW2Z2dx4q/?ref=app

15th Nov 2022, 2:56 PM
Clov
5 Answers
+ 2
Your loop condition argc-1 => 2-1 = 1 is always true. So causing segmentation fault. Use i < argc
15th Nov 2022, 6:51 PM
Jayakrishna 🇼🇳
+ 1
At least you have seen the code that you posted?
15th Nov 2022, 4:01 PM
KrOW
KrOW - avatar
+ 1
Thks its worked u solved it
15th Nov 2022, 6:59 PM
Clov
0
And it run?
15th Nov 2022, 4:03 PM
KrOW
KrOW - avatar
0
~ $ ./arg one two three argc = 4 Segmentation fault
15th Nov 2022, 4:07 PM
Clov