It looks like you're using an Ad Blocker.

Please white-list or disable AboveTopSecret.com in your ad-blocking tool.

Thank you.

 

Some features of ATS will be disabled while you continue to use an ad-blocker.

 

Noob to c programming help!

page: 2
0
<< 1   >>

log in

join
share:

posted on Dec, 14 2005 @ 08:20 PM
link   
Sure, just use an additional counter to keep track of the shift value/ offset or whatever you're calling it. For this example I'm going to use 'x' and 'y' since bbcode will hide the 'i' in brackets.



int x;
int y = 0;

// Encrypted the text
for(x = 0; x < encrypt_text_length; x++)
[
// if the current character is a space reset the offset to zero
// otherwise add one to the offset
if(buff[x] == ' ')
[
y = 0;
]
else
[
y++;
]

buff[x] = ShiftCharacter(buff[x],shift_value,y);
]




posted on Dec, 14 2005 @ 09:12 PM
link   
Am i missing something, i added that snippet in and changed the x's to i's. But it doesnt reset the shift value for every word, it still keeps adding??



[edit on 14-12-2005 by Uber Fr0g]



new topics
 
0
<< 1   >>

log in

join