Hello everybody.
I'm having a hard time with this one.
Any help is kindly appreciated.
I'm writing a C program in which I want to generate a scrambled alphabet and
store it in char array. When the program is run from the command line, it accepts
an argument(a key), from the user and uses it to randomly shuffle the letters, as
it writes them into the array. The goal is, to use the key to generate a
scrambled alphabet and than share this key with another user, who will run the
program on his computer and be able to generate the same scrambled alphabet with
the shared key.
Anyway. I'm having trouble getting that argument.
I use it to seed the srand
..but when I print it out, I get some bogus numbers instead of what I enter
as an integer argument(ex 131556) when I run the program.
I tried to, instead, create an int variable and assign the value of argv[1]
to it and it didn't work. Compiler complains about type casting and different
sizes of types.
What am I doing wrong?