author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Sat, 13 Dec 2008 17:58:00 +0100 | |
changeset 8 | 96d16dfe787a |
parent 0 | af501b0c1716 |
child 9 | c3fecc82ade6 |
permissions | -rw-r--r-- |
0 | 1 |
/** |
2 |
* $Id: crypt.c,v 1.1.1.1 2008-04-28 17:32:53 mbroeker Exp $ |
|
3 |
* $Source: /development/c/demos/crypt.c,v $ |
|
4 |
* |
|
5 |
*/ |
|
6 |
||
7 |
#include <stdio.h> |
|
8 |
#include <stdlib.h> |
|
9 |
#include <string.h> |
|
10 |
||
11 |
int main (int argc, char **argv) |
|
12 |
{ |
|
13 |
char *data; |
|
14 |
int i; |
|
15 |
||
16 |
if (argc != 2) { |
|
17 |
printf ("Usage: %s <str>\n", argv[0]); |
|
18 |
return EXIT_SUCCESS; |
|
19 |
} |
|
20 |
||
21 |
/* |
|
22 |
* Its already allocated |
|
23 |
*/ |
|
24 |
data = argv[1]; |
|
25 |
||
26 |
for (i = 0; data[i]; i++) |
|
27 |
data[i] = data[i] + 1; |
|
28 |
||
29 |
printf ("EnCrypted Data: %s\n", data); |
|
30 |
||
31 |
for (i = 0; data[i]; i++) |
|
32 |
data[i] = data[i] - 1; |
|
33 |
||
34 |
printf ("DeCrypted Data: %s\n", data); |
|
35 |
||
8
96d16dfe787a
We use return EXIT_SUCCESS instead of return 0
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
0
diff
changeset
|
36 |
return EXIT_SUCCESS; |
0 | 37 |
} |