Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Halp with C code assignment!
#4

Also, if you'd rather fix your code then rewrite something similar to mine, check your logic here.

Code:
if ((orig[i] < 'a' && orig[i] > 'z') || (orig[i] < 'A' && orig[i] > 'Z'))
hide[i] = orig[i];
else if (orig[i] == ' ')
hide[i] = ' ';
else if (n == 1)
hide[i] = orig[i]+1;
else if (n == 2)
hide[i] = orig[i]-2;
else if (n == 3)
hide[i] = orig[i]+3;
else if (n == 4)
hide[i] = orig[i]-4;

It doesn't make much sense to me and hurts my head. Consider making a function to rotate characters like I did.
Reply


Messages In This Thread
Halp with C code assignment! - by jwstohr - Jan 26, 2009, 08:27 PM
Halp with C code assignment! - by jwstohr - Jan 26, 2009, 08:29 PM
Halp with C code assignment! - by Drunken F00l - Jan 27, 2009, 05:09 AM
Halp with C code assignment! - by Drunken F00l - Jan 27, 2009, 05:28 AM
Halp with C code assignment! - by jwstohr - Jan 27, 2009, 09:44 AM
Halp with C code assignment! - by Username - Feb 02, 2009, 01:07 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)