how do you get the ASCII value of multiple letters? I'm not a hardcore coder as you may notice.. But i'd really like to try making an easy encrypter/decrypter
I just downloaded Visual Studio 6, but i haven't had the time to try it at all.
I also have QBasic and FreeBasic, anyone now how to do it in some of those languages? or just tell me what to download an i'll do it. (is there any idea to start with c++ just like that?)
maybe you could point me to a tutorial somewhere but i haven't found anything searching the web, so please help me!
ASCII value from multiple letters
- Jontebullen
- On the way to fame!
- Posts: 48
- Joined: 03 Apr 2007, 16:00
- 17
- Location: south of the northpole
- Contact:
- Jontebullen
- On the way to fame!
- Posts: 48
- Joined: 03 Apr 2007, 16:00
- 17
- Location: south of the northpole
- Contact:
http://www.vortex.prodigynet.co.uk/misc/ascii_conv.js kinda yeah, but isn't there an easier way, that script confuses me
- bad_brain
- Site Owner
- Posts: 11636
- Joined: 06 Apr 2005, 16:00
- 19
- Location: In your eye floaters.
- Contact:
here's a simple one for C++:
and well, like the comment in the code says, the "trick" is simply to convert the char variable into an int (numeric) one...
Code: Select all
#include <iostream>
using namespace std;
int main()
{
char word[32];
int x = 0;
cout << "Please enter the word (maximum 32 characters):\n";
cin >> word;
cout << "The ASCII for this word is:\n";
while (word[x] != '\0') // While the string isn't at the end...
{
cout << int(word[x]); // Transform the char to int
x++;
}
cout << "\n";
return 0;
}