|
|
 |
 |
 |
 |
register |
bbs |
search |
rss |
faq |
about
|
 |
 |
meet up |
add to del.icio.us |
digg it
|
 |
 |
| Network (in)Security Interesting hacks and cracks. Info on firewalls, TCP/IP, encryption, networks, and security. The ins and outs of the phone system, caller services, how things work, what's illegal and what's not, cellular phones, beepers, telephony legislation, the PUC, ISDN, taps, who's listening, and switches. Talking about phones, hacking systems, technical advice, and such is completely LEGAL in the United States -- it's covered by the First Amendment. What's illegal is conspiracy to commit a crime. So if you say something like "Meet me at 2am so we can crack a can" or "I changed my cell phone's number myself" you are criminally liable. Stating "You can crack a can by doing thus-and-so" or "If you wanted to change a cell phone's number, you could do it like so" is perfectly OK. Posting passwords, calling card numbers, or credit card numbers is forbidden on this network. Posting such info will get you booted off the net. |
 |
|
|
#1
 2004-12-22, 06:11
|
marleyandmarley 
Regular
|
|
|
|
Changing Text To char
OK does anyone have a site or know how to change text into chars.
Ex ' is char(39)
|
|
#2
 2004-12-22, 06:49
|
cense 
Regular
|
|
|
|
Re: Changing Text To char
code:<pre>#!/usr/bin/perl
print("Enter string: ");
my $string = <STDIN>;
while($string =~ /(.)/g) {
$ord = ord($1);
print "$ord ";
}
print "\n";</pre>
|
|
#3
 2004-12-22, 06:53
|
Eklipze 
Regular
|
|
|
|
Re: Changing Text To char
code:<pre>
#include <iostream>
using namespace std;
int main() {
char input;
for(; ;) {
cout << "Enter a character to determine it's ascii value: ";
cin >> input;
cout << "The ascii value of " << input << " is " << int(input) << endl;
}
return 0;
}
</pre>
EDIT: Cense beat me to it, but at least now you have two different languages to work with.
[This message has been edited by Eklipze (edited 12-22-2004).]
|
|
#4
 2004-12-22, 07:20
|
marleyandmarley 
Regular
|
|
|
|
Re: Changing Text To char
OK so the first one is in pearl and the second is in C++
Anyone got anything in PHP?
Because my site doesnt support perl, and I dont have anything to compile a c++ program.
|
|
#5
 2004-12-22, 13:47
|
Hush 
Regular
|
|
|
|
Re: Changing Text To char
code:<pre>
<?php
$char_string = "char(39)";
$chr_string = chr(str_replace("char(","",substr($char_string,0,-1)));
echo $chr_string;
?>
</pre>
Obviously you could set $char_string through user input.
|
|
#6
 2004-12-23, 20:45
|
caffeine_junky 
Regular
|
|
|
|
Re: Changing Text To char
Are you talking abotu inputting strings? if so I believe you could do something like:
code:<pre>
#include <iostream.h>
#include <string.h>
int main()
{
char[20] string;
cout<<"Please enter a string"<<endl;
cin>>string;
cout<<"You entered "<<string;
</pre>
[This message has been edited by caffeine_junky (edited 12-23-2004).]
|
|
 |
 |
To the best of our knowledge, the text on this page may be freely reproduced and distributed.

totse.com certificate signatures
|
 |
 |
About | Community | Bad Ideas | Drugs | Ego | Erotica | Fringe | Society | Technology
|
 |
 |
 |
 |
|
|