Question
Can I get some help on converting this code into a switch statement in C Programming? CONVERT THIS CODE INTO A SWITCH STATEMENT IN C
Can I get some help on converting this code into a switch statement in C Programming?
CONVERT THIS CODE INTO A SWITCH STATEMENT IN C PROGRAMMING
for (int i = 0; i < argc; i++) { if (strcmp(argv[i], "-h") == 0) { printHelpMessage(); } else if (strlen(argv[i]) > 1 && argv[i][0] == '-' && argv[i][1] == '-') { from = &(argv[i][2]); } else if (strlen(argv[i]) > 1 && argv[i][0] == '-' && argv[i][1] == '+') { to = &(argv[i][2]); } else if (strcmp(argv[i], "-i") == 0) { in = argv[i + 1]; } else if (strcmp(argv[i], "-o") == 0) { out = argv[i + 1]; } }
thanks
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started