Posted: Sun Jun 23, 2013 4:49 am Post subject: 4 bytes value in string
Hey!
I want to ask how CE converts a string's 4 byte value to string? Like there is an username and when I change it's type to 4 bytes I get XXXXXXXXXXX... and then change it back to string, I get the correct string I want.
When I use encoding(UTF8) in C# it only displays the first 4 letters of the username(but the correct letters).
I'm writing a trainer in C# and want to display the username in it.
if you know, in ascii every character has a 1 byte value.
so any number could be translated into characters.
and utf8 it's jut another convention
https://en.wikipedia.org/wiki/UTF-8
look at codepage layout
every letter corresponds to a 2byte number in utf8
in c plus plus you could use "reinterpret cast" to reinterpret a string as an integer
an example would be
Code:
char x[]="hello"
reinterpret cast *x as integer *int with identifier z //look up the net for the correct syntax
std::cout << z
that should diplay a number
otherwise
int x = 30495864
reinterpret cast *x as string *char with identifier z
std::cout << z
that should display a string (it will go on displaying till it finds a zero value)
or
int x[]={ number, number ,0 }
reinterpret cast ...
cout z
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum