473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating and using a lookup array

How would you use a lookup table of char*, I mean, how would you find
out where the intersection of D and E is? And how would you read two
strings, and parse each character. Here's the array:

const char* vigenereTable=new char[26][26];
*vigenereTable=,Q
{
{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y ,Z},
{B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ,A},
{C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A ,B},
{D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B ,C},
{E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C ,D},
{F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D ,E},
{G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E ,F},
{H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F ,G},
{I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G ,H},
{J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H ,I},
{K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I ,J},
{L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J ,K},
{M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K ,L},
{N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L ,M},
{O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M ,N},
{P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N ,O},
{Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O ,P},
{R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P ,Q},
{S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q ,R},
{T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R ,S},
{U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S ,T},
{V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T ,U},
{W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U ,V},
{X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V ,W},
{Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W ,X},
{Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X ,Y},
};

Can you help me, I want to build a Vigenere cipher program. Thanks for
the help!!!

Sep 24 '05 #1
26 1691
Protoman wrote:
How would you use a lookup table of char*, I mean, how would you find
out where the intersection of D and E is? And how would you read two
strings, and parse each character. Here's the array:

const char* vigenereTable=new char[26][26];
*vigenereTable=,Q
If you assume that all your letters are sequential integral
values (true for ASCII, but not all character sets, EBCDIC
for example has a couple of gaps (betwee I and J and R and
S for quaint historical reasons), there are better ways
to do this sort of cipher.

Second, if the table is always going to be 26x26, there's
no point in using dynamic allocation:

char vignereTable[26][26]
{
{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y ,Z},
{B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ,A},

The above will work except A isn't defined. If you want
to use literal character values you need apostrophes around
it:
'A', 'B', ...
Sep 24 '05 #2
OK, I changed that, but how do I find the intersection of, say, D and
F?

Sep 24 '05 #3
"Protoman" writes:
How would you use a lookup table of char*, I mean, how would you find
out where the intersection of D and E is? And how would you read two
strings, and parse each character. Here's the array:

const char* vigenereTable=new char[26][26];
*vigenereTable=,Q
What's the comma for? Doesn't your compiler complain?
{
{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y ,Z},
How do you expect to fit 51 characters into a 26 element array?
{B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z ,A},
{C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A ,B},
{D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B ,C},
{E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C ,D},
{F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D ,E},
{G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E ,F},
{H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F ,G},
{I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G ,H},
{J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H ,I},
{K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I ,J},
{L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J ,K},
{M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K ,L},
{N,O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L ,M},
{O,P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M ,N},
{P,Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N ,O},
{Q,R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O ,P},
{R,S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P ,Q},
{S,T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q ,R},
{T,U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R ,S},
{U,V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S ,T},
{V,W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T ,U},
{W,X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U ,V},
{X,Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V ,W},
{Y,Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W ,X},
{Z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X ,Y},
};

Can you help me, I want to build a Vigenere cipher program. Thanks for
the help!!!


If you can manage to get your intent into a program that compiles, D is the
4th letter of the alphabet and E is the 5th. Adjusting for the fact that
C++ arrays start at 0, *something like* table[3][4];

As has already been pointed out, you are doing this the hard way for most
practical purposes.
Sep 24 '05 #4
Here's the new lookup table:

namespace
{
const char vigenereTable[26][26]=
{
{'A','B','C','D','E','F','G','H','I','J','K','L',' M','N','O','P','Q','R','S','T','U','V','W','X','Y' ,'Z'},
{'B','C','D','E','F','G','H','I','J','K','L','M',' N','O','P','Q','R','S','T','U','V','W','X','Y','Z' ,'A'},
{'C','D','E','F','G','H','I','J','K','L','M','N',' O','P','Q','R','S','T','U','V','W','X','Y','Z','A' ,'B'},
{'D','E','F','G','H','I','J','K','L','M','N','O',' P','Q','R','S','T','U','V','W','X','Y','Z','A','B' ,'C'},
{'E','F','G','H','I','J','K','L','M','N','O','P',' Q','R','S','T','U','V','W','X','Y','Z','A','B','C' ,'D'},
{'F','G','H','I','J','K','L','M','N','O','P','Q',' R','S','T','U','V','W','X','Y','Z','A','B','C','D' ,'E'},
{'G','H','I','J','K','L','M','N','O','P','Q','R',' S','T','U','V','W','X','Y','Z','A','B','C','D','E' ,'F'},
{'H','I','J','K','L','M','N','O','P','Q','R','S',' T','U','V','W','X','Y','Z','A','B','C','D','E','F' ,'G'},
{'I','J','K','L','M','N','O','P','Q','R','S','T',' U','V','W','X','Y','Z','A','B','C','D','E','F','G' ,'H'},
{'J','K','L','M','N','O','P','Q','R','S','T','U',' V','W','X','Y','Z','A','B','C','D','E','F','G','H' ,'I'},
{'K','L','M','N','O','P','Q','R','S','T','U','V',' W','X','Y','Z','A','B','C','D','E','F','G','H','I' ,'J'},
{'L','M','N','O','P','Q','R','S','T','U','V','W',' X','Y','Z','A','B','C','D','E','F','G','H','I','J' ,'K'},
{'M','N','O','P','Q','R','S','T','U','V','W','X',' Y','Z','A','B','C','D','E','F','G','H','I','J','K' ,'L'},
{'N','O','P','Q','R','S','T','U','V','W','X','Y',' Z','A','B','C','D','E','F','G','H','I','J','K','L' ,'M'},
{'O','P','Q','R','S','T','U','V','W','X','Y','Z',' A','B','C','D','E','F','G','H','I','J','K','L','M' ,'N'},
{'P','Q','R','S','T','U','V','W','X','Y','Z','A',' B','C','D','E','F','G','H','I','J','K','L','M','N' ,O'},
{'Q','R','S','T','U','V','W','X','Y','Z','A','B',' C','D','E','F','G','H','I','J','K','L','M','N','O' ,'P'},
{'R','S','T','U','V','W','X','Y','Z','A','B','C',' D','E','F','G','H','I','J','K','L','M','N','O','P' ,'Q'},
{'S','T','U','V','W','X','Y','Z','A','B','C','D',' E','F','G','H','I','J','K','L','M','N','O','P','Q' ,'R'},
{'T','U','V','W','X','Y','Z','A','B','C','D','E',' F','G','H','I','J','K','L','M','N','O','P','Q','R' ,'S'},
{'U','V','W','X','Y','Z','A','B','C','D','E','F',' G','H','I','J','K','L','M','N','O','P','Q','R','S' ,'T'},
{'V','W','X','Y','Z','A','B','C','D','E','F','G',' H','I','J','K','L','M','N','O','P','Q','R','S','T' ,'U'},
{'W','X','Y','Z','A','B','C','D','E','F','G','H',' I','J','K','L','M','N','O','P','Q','R','S','T','U' ,'V'},
{'X','Y','Z','A','B','C','D','E','F','G','H','I',' J','K','L','M','N','O','P','Q','R','S','T','U','V' ,'W'},
{'Y','Z','A','B','C','D','E','F','G','H','I','J',' K','L','M','N','O','P','Q','R','S','T','U','V','W' ,'X'},
{'Z','A','B','C','D','E','F','G','H','I','J','K',' L','M','N','O','P','Q','R','S','T','U','V','W','X' ,'Y'},
};
}

How do I find the intersection of, say, D and O? And how to I parse
induvidual characters from a string?

Sep 24 '05 #5
OK the, what's the easy way?

Sep 24 '05 #6
"Protoman" wrote:
OK the, what's the easy way?
The following was posted about a week ago and it was directed at you.
Please read it and try to get a little meaning out of the post. Please post
context in your messages if you expect any help from me. WTF means ::"what
the fuck" in case it was too subtle for you.
____

"Protoman" writes:
That's an ebook I have to purchase; I'd like a link to a place that's
free.


Do you have any idea what I see on my screen? I see:

"That's an ebook I have to purchase; I'd like a link to a place that's
free."

How in hell is anyone supposed to know WTF you are talking about?

In the off chance you are talking to me, I suggest this. Actually CLICK on
the link. Don't hypothesize what might happen if you click, actually CLICK.
Can you do that? Will you do that?

Jeez!

-- Osmium


Sep 24 '05 #7
OK, I'll do that.

Sep 24 '05 #8
"Protoman" <Pr**********@gmail.com> writes:
OK the, what's the easy way?


The easy way for what? Please learn to quote enough of the message you're
replying to for your own message to make sense.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Sep 25 '05 #9
For what Osminium said!!!

Sep 25 '05 #10
"Protoman" <Pr**********@gmail.com> writes:
For what Osminium said!!!


That's not even a sentence. What are you talking about? I have no idea what
"Osminium" said.

Please - learn to use Usenet correctly. When you reply to someone's post, you
need to quote enough of what they said, like I quoted your post above. That
way, if the post you're replying to hasn't arrived at my server yet, or has
expired and been deleted, your post will make sense.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Sep 25 '05 #11
Protoman wrote:
Here's the new lookup table: How do I find the intersection of, say, D and O? And how to I parse
induvidual characters from a string?


What do you mean intersection?

You access the characers in a string either with an iterator
or with the [ ] operator and some counter.
Sep 25 '05 #12
Ron Natalie wrote:
Protoman wrote:
Here's the new lookup table:

How do I find the intersection of, say, D and O? And how to I parse
induvidual characters from a string?


What do you mean intersection?

You access the characers in a string either with an iterator
or with the [ ] operator and some counter.


Given a secret key, "SECRET" and a message "MESSAGE" to encrypt, the
program would need to look up the following row & column intersections
in the Vigeneres table: {S, M}, {E, E}, {C, S}, {R, S}, {E, A}, {T,
G}, {S, E} to find how each letter should be encoded.

The program should first "normalize" the key and message inputs,
uppercasing lower case letters, rejecting any character that is not a
letter. Then it can call a function like the one below to find each
letter in the encoded message:

char EncodeLetter( char inMessageChar, char inSecretChar)
{
assert( inMessageChar >= 'A' and inMessageChar <= 'Z');
assert( inSecretChar >= 'A' and inSecretChar <= 'Z');

return vigenereTable[inSecretChar - 'A'][inMessageChar - 'A'];
}

For instance, the message in the above example would be encoded as:
EIUJEZW.

Greg

Sep 25 '05 #13
I'll try that.

Sep 26 '05 #14
Greg, here's the main funct of my new code:

int main()
{
string cleartext;
string key;
cout << "Enter the cleartext[10 char max]: " << endl;
getline(cin,cleartext,'\n');
cout << "Enter the key[10 char max]: " << endl;
getline(cin,key,'\n');
for(int i=0,int j=0,int k=0;
i<cleartext.length(),j<key.length;i++,j++,k++)
{
string encrypt[k]=vigenereTable[cleartext[i]-'A'][key[j]-'A'];
}
system("PAUSE");
return 0;
}

It doesn't compile; could you help me, please? Thanks!!!

Sep 26 '05 #15
"Protoman" <Pr**********@gmail.com> writes:
I'll try that.


You'll try what???

Please learn to post correctly. Your message makes no sense, because you
didn't bother quoting any of the message you're replying to.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Sep 26 '05 #16
Protoman wrote:
Greg, here's the main funct of my new code:

int main()
{
string cleartext;
string key;
cout << "Enter the cleartext[10 char max]: " << endl;
getline(cin,cleartext,'\n');
cout << "Enter the key[10 char max]: " << endl;
getline(cin,key,'\n');
for(int i=0,int j=0,int k=0;
for (int i=0, j=0, k=0;
i<cleartext.length(),j<key.length;i++,j++,k++)
i<cleartext.length() && j<key.length(); i++, j++, k++)

(at a guess)
{
string encrypt[k]=vigenereTable[cleartext[i]-'A'][key[j]-'A'];
}
system("PAUSE");
return 0;
}

It doesn't compile; could you help me, please? Thanks!!!


It might compile now, but I don't think it is going to do what you want.
The loop looks completely wrong.

john
Sep 26 '05 #17
Protoman wrote:
Greg, here's the main funct of my new code:

int main()
{
string cleartext;
string key;
cout << "Enter the cleartext[10 char max]: " << endl;
getline(cin,cleartext,'\n');
cout << "Enter the key[10 char max]: " << endl;
getline(cin,key,'\n');
for(int i=0,int j=0,int k=0;
i<cleartext.length(),j<key.length;i++,j++,k++)
{
string encrypt[k]=vigenereTable[cleartext[i]-'A'][key[j]-'A'];
}
system("PAUSE");
return 0;
}

It doesn't compile; could you help me, please? Thanks!!!


At least this is getting somewhere. I would recommned first thinking
about what this program has to do, and then how it will do it. Writing
a lot of code without a clear idea how to the solve problem can waste a
lot of time.

The program needs to encode the cleartext by substituting all of its
letters with encoded ones. Once the program has reached the end of the
clear text, it is done. So the program needs to loop from the first to
the last character of the cleartext.

std::string encrypted;

for (int = 0; i < cleartext.length(); i++)
{
encrypted += [cleartext[i]-'A'][key[ ?? ] - 'A'];

For output, the program will append each encoded character to
encrypted, a std::string. A more difficult problem is how to specify
the index for the key. If the key is as long or longer than the
message, then the index for the key and message would always be equal.
But if the key is shorter than the message, it has to "cycle": return
to the first character after the last one as been reached. Note that
there is still only one loop being executed, it's only the value of the
key's index that can vary from the cleartext's index i.

So how does the program calculate the index for key? One way is to
declare another index, j, increment j and when j >= key.length() set j
back to 0. That works, but a more streamlined approach could calculate
the key's index from i, and would not need another variable:

encrypted += [cleartext[i]-'A'][key[ i % key.length()]-'A'];

The modulo operator, %, forces the key's index to "wrap around" should
the end of the key text be reached before the full message has been
encoded.

The program still needs more work, especially validating its input: if
the user types a lower case letter, make it upper case. For any other
character just add it to the encrypted message, as is. As the program
stands now, unless the user types only capital letters, it is likely to
crash.

Greg

Sep 26 '05 #18
OK, I'm trying to write a funct to decipher the code, but it keeps
reencrypting it:

string decipher(const string& ciphertext,const string& key)
{
string decrypted;
for(int i=0; i< key.length();i++)
decrypted+=vTable[key[i]-'A'][ciphertext[i%ciphertext.length()]-'A'];
return decrypted;
}

Can you help me? Here's the enciphering funct:

string encipher(const string& cleartext,const string& key)
{
string encrypted;
for(int i=0; i< cleartext.length();i++)
encrypted+=vTable[cleartext[i]-'A'][key[i%key.length()]-'A'];
return encrypted;
}

Any ideas as to what's wrong? It encipher correctly, but it deciphers
wrong. Thanks!!!

Sep 26 '05 #19
Protoman wrote:
OK, I'm trying to write a funct to decipher the code, but it keeps
reencrypting it:

string decipher(const string& ciphertext,const string& key)
{
string decrypted;
for(int i=0; i< key.length();i++)
decrypted+=vTable[key[i]-'A'][ciphertext[i%ciphertext.length()]-'A'];
return decrypted;
}

Can you help me? Here's the enciphering funct:

string encipher(const string& cleartext,const string& key)
{
string encrypted;
for(int i=0; i< cleartext.length();i++)
encrypted+=vTable[cleartext[i]-'A'][key[i%key.length()]-'A'];
return encrypted;
}

Any ideas as to what's wrong? It encipher correctly, but it deciphers
wrong. Thanks!!!


To encrypt each character in the message originally, the program used
the clear text letter as an index into the table, and then used the key
as an index along the opposing axis to select the encrypted letter.

To decrypt an encrypted letter, the program performs the same two steps
but in reverse order: it first uses the key to select along the first
axis, and then uses the encrypted letter as an index along the second
axis to locate the plaintext letter.

In other words, if the program encodes a letter with this expression:

vTable[cleartext[i]-'A'][key[i%key.length()]-'A'];

it should then decode it with this one:

vTable[key[i%key.length()]-'A'][encrypted[i]-'A'];

Greg

Sep 27 '05 #20

Greg wrote:
Protoman wrote:
OK, I'm trying to write a funct to decipher the code, but it keeps
reencrypting it:

string decipher(const string& ciphertext,const string& key)
{
string decrypted;
for(int i=0; i< key.length();i++)
decrypted+=vTable[key[i]-'A'][ciphertext[i%ciphertext.length()]-'A'];
return decrypted;
}

Can you help me? Here's the enciphering funct:

string encipher(const string& cleartext,const string& key)
{
string encrypted;
for(int i=0; i< cleartext.length();i++)
encrypted+=vTable[cleartext[i]-'A'][key[i%key.length()]-'A'];
return encrypted;
}

Any ideas as to what's wrong? It encipher correctly, but it deciphers
wrong. Thanks!!!


To encrypt each character in the message originally, the program used
the clear text letter as an index into the table, and then used the key
as an index along the opposing axis to select the encrypted letter.

To decrypt an encrypted letter, the program performs the same two steps
but in reverse order: it first uses the key to select along the first
axis, and then uses the encrypted letter as an index along the second
axis to locate the plaintext letter.

In other words, if the program encodes a letter with this expression:

vTable[cleartext[i]-'A'][key[i%key.length()]-'A'];

it should then decode it with this one:

vTable[key[i%key.length()]-'A'][encrypted[i]-'A'];

Greg


Thanks!!!!

Sep 27 '05 #21
How do I turn this into an cleartext autokey; it only needs one letter
to start the show.

Sep 28 '05 #22
Protoman wrote:

How do I turn this into an cleartext autokey; it only needs one letter
to start the show.


How do you turn *what* into an cleartext autokey?

Protoman. You have been advised so many times to include some context
into your postings. You should already know the rules of this group.

* Quote from the message you are replying to, in order to create a context
of your posting (everybody knows what you are talking about, just by looking
at this single post).

* Post the code you already have and ask specific questions about it.
This not only raises your chance that somebody might answer. It also
allows us to figure out what you already know and tailor our answers
to your level of knowledge (There is always more then one way to skin
a cat).

* If you have error messages from the compiler, post them also. Mark the line
the error message talks about, such that nobody has to count lines in a newsreader.

* Always keep in mind: You have probably spent hours on your problem and couldn't solve
it. We see your problem just for 5 seconds and most often we don't see all of your code.
So if you could not figure it out for hours how do you expect anyone to sort it out
in a few seconds?
So post everything related to your problem. If in doubt post the entire program

* Shorten your program and remove everything not related to your actual problem.
If eg. you have troubles in writing a file, then most likely the code to list
data on cout is not related to it. Remove that code -> shorter program

Before you post that: make sure, your problem is still in the sortened program.

Yes: This requires some work from you. But in a lot of cases during this 'code stripping'
the problem is discovered by the OP. And there is nothing better then a problem that you
can solve on your own.

If you still fear that work, then remember that *we* have to do that work. And we are
lazy. So if in doubt, we refuse to do that work. Work that could have been done by the OP.
-> You don't get an answer.

* Be nice to us and we are nice to you.

--
Karl Heinz Buchegger
kb******@gascad.at
Sep 28 '05 #23
I do not fear work!!!!!!!!!!!! I pratically did the whole thing myself,
and I found an easier method of doing it!!! To do an autokey, you need
to take a "priming key", like X, and append the cleartext to it, until
the key length equeals the cleartext length.

Sep 28 '05 #24

"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I do not fear work!!!!!!!!!!!! I pratically did the whole thing myself,
and I found an easier method of doing it!!! To do an autokey, you need
to take a "priming key", like X, and append the cleartext to it, until
the key length equeals the cleartext length.

Congratulations. Not that we have any idea what the heck you are talking
about, of course. Which part of the earlier conversation (re-posted below)
did you not understand?
Protoman. You have been advised so many times to include some context
into your postings. You should already know the rules of this group.

* Quote from the message you are replying to, in order to create a context
of your posting (everybody knows what you are talking about, just by
looking
at this single post).


(Do you need instructions on how to quote from the message to which you're
replying?)

-Howard

Sep 28 '05 #25
Yes, how do I quote?

Sep 30 '05 #26

Protoman wrote:
Yes, how do I quote?


Since it appears that you are using Google as your news reader, I will
give you Google specific instructions. Quoting is actually very easy,
much easier than implementing a Vigenere encrypter, that is for sure.

The trick is when replying to a posting do NOT click on the "Reply"
link under the news posting. Instead click on the "Show Options" link
on the top line of the posting next to the date. Doing so reveals a
line of additional options including a "Reply" link. DO click on this
reply link since it will include the message text from the original
posting in your reply. Edit to suit.

Hope that helps,

Greg

Sep 30 '05 #27

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Thomas Matthews | last post by:
Hi, How do I create a const table of pointers to member functions? I'm implementing a Factory pattern (or jump table). I want to iterate through the table, calling each member function until a...
2
by: C-man | last post by:
Yeah, for some reason I can seem to find an algorithm that will simple but items into the tree in fashion such that a new leaf can't be added to a new level till all the leafs at the previous level...
3
by: Julius Mong | last post by:
Hi all, I'm doing this: // Test char code wchar_t lookup = {0x8364, 0x5543, 0x3432, 0xabcd, 0xef01}; for (int x=0; x<5; x++) { wchar_t * string = (wchar_t*) malloc(sizeof(wchar_t)); string =...
8
by: Nanda | last post by:
hi, I am trying to generate parameters for the updatecommand at runtime. this.oleDbDeleteCommand1.CommandText=cmdtext; this.oleDbDeleteCommand1.Connection =this.oleDbConnection1;...
3
by: John | last post by:
Hi, I need to build a BAUDOT lookup table for an encoder. I see to use a char as the index 'A' or 'B' and get back an array of booleans (five elements long). Baudot = {00011} Baudot =...
11
by: Matthew Wells | last post by:
Hello. I have figured out how to create an instance of an object only knowing the type by string. string sName = "MyClassName"; Type t = Type.GetType(sName); Object objNew =...
9
by: Tony Proctor | last post by:
I need to create a process Singleton object for an ASP application, but I'm having some odd issues In my GLOBAL.ASA, I have an <OBJECTelement specifying the relevant ProgID with RUNAT=Server and...
2
by: tfurubay | last post by:
Hi, I am setting up an address reader in access. I'm hoping to create a form with a lookup field. When i enter an account number in the lookup field, i wish to return the customer name, address,...
1
by: DaveD | last post by:
Let's say I have a collection ("items") of objects that each have a "string Name" property. I understand I can create a loop like this: foreach (string name in names) { var item = (from x in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.