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); }