Change the ones with Bold text on the code accordingly. The code within the if statement...

50.1K

Verified Solution

Question

Programming

Change the ones with Bold text on the code accordingly.

The code within the if statement is not doing the correctprocess. When your code goes to the c2 function it should bepassing argv[1] to it.

(side note: your program design of calling the function c1(),c2() c3() is a bit odd, but it can work)

if (argv[2] == _c2)          {            ret = c1(argv[2]);            ret = ret >> 2;//divide by 2 to make it 8 bit         }        else if (argv[2] == _c1)        {            ret = c2(argv[1]);            ret = ret >> 2;//divide by 2 to make it 8 bit // this should be done in the c2() funciton        }        else if (argv[1] == _c3)        {            ret = c3(argv[2]);            ret = ret >> 2;//divide by 2 to make it 8 bit // this should be done in the c2() funciton        }        else if (argv[1] == _c4)        {            ret = c4(argv[2]);            ret = ret >> 2;//divide by 2 to make it 8 bit  // this should be done in the c2() funciton        }        else {            cout << \"'V' - Invalid operation selection\" << endl;            exit(0);        }

Answer & Explanation Solved by verified expert
3.9 Ratings (770 Votes)
Given To change the ones with Bold text on the code accordingly if argv2 c2 ret c1argv2 ret ret 2divide by 2 to make it 8 bit else if argv2 c1 ret c2argv1 ret ret 2divide    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students