X3eRo0
But I want them together too
Talula
unsigned int x; std::stringstream ss; ss << std::hex << "fffefffe"; ss >> x;
X3eRo0
Ok
X3eRo0
Lemme see
X3eRo0
Also if you have python installed
X3eRo0
Pls do this
X3eRo0
import struct
X3eRo0
struct.pack("<I",0x41414141)
X3eRo0
This number
X3eRo0
0x41414141 will be converted to \x41\x41\x41\x41
Ludovic 'Archivist'
struct.pack("<I",0x41414141)
Is the expected output "0x41414141"?
Talula
I'm sorry @X3eRo0, you are not making any sense to be accurate... What do you want to do? Why in the world are you comparing C++ with python?
X3eRo0
I am not comparing c++ with python
X3eRo0
I was telling you how you could do something like that in oython
X3eRo0
b'AAAA'
Do the same in python 2
Talula
Then what are you talking about? I explained you 0x00 is 00 in Memory... 0x00 in String is a string... now what do you wanna do with it?
X3eRo0
0x41414141 will be converted to \x41\x41\x41\x41
And you will get this \x41\41\x41\x41
Ludovic 'Archivist'
Do the same in python 2
Do you also expect us to speak Latin?
X3eRo0
In python3 the output is bytearray
X3eRo0
But in python2 it's of class 'str'
Ludovic 'Archivist'
Pls try to understand
What input type do you want? What output and what format for it if it is a std::string?
Ludovic 'Archivist'
Give us a signature
MᏫᎻᎯᎷᎷᎬᎠ
Ludovic 'Archivist'
Example : std::string convert (size_t);
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
I wonder
Ludovic 'Archivist'
How it's implemented
Lots of tail recursion
X3eRo0
I am working in c so input is of type char * and the input will contain charecters from "0" to "9" and "a" to "f" the output I want is the raw byte reprentation like for example in memory "A" is stored like \x41 where \x41 is ASCII code of A. Since my input is char * it will be stored in memory with their ASCII codes. For example if I enter "ABCD" it will be stored as \x41\x42\x43\x44 but I want something like \xAB\xCD in memory
MᏫᎻᎯᎷᎷᎬᎠ
Lots of tail recursion
Yeah But how the next call know the second format string at compile time?!
X3eRo0
Now pls help
X3eRo0
Sorry
X3eRo0
😞
MᏫᎻᎯᎷᎷᎬᎠ
Now pls help
In order for someone to help you, you MUST address your questions properly
X3eRo0
In order for someone to help you, you MUST address your questions properly
I am working in c so input is of type char * and the input will contain charecters from "0" to "9" and "a" to "f" the output I want is the raw byte reprentation like for example in memory "A" is stored like \x41 where \x41 is ASCII code of A. Since my input is char * it will be stored in memory with their ASCII codes. For example if I enter "ABCD" it will be stored as \x41\x42\x43\x44 but I want something like \xAB\xCD in memory
X3eRo0
Are you new to C or something? It is stored as \x41 that is just Hex reprentation and that is how it works.
That's why I wanted to convert my original string to something that can actually be stored as \xAB\xCD
X3eRo0
Ok
Talula
I leave implementation of hexdigit_to_int to you
That is not what he wants to do... I'm still trying to figure out what he wants really...
X3eRo0
That is not what he wants to do... I'm still trying to figure out what he wants really...
Nevermind dude he solved my problem idk what are not understanding
Ludovic 'Archivist'
That is not what he wants to do... I'm still trying to figure out what he wants really...
I figured it out, but he is shitty at explaining, he want to convert a string of hexdigits to the binary representation of the digits
X3eRo0
Forgive me
Talula
I figured it out, but he is shitty at explaining, he want to convert a string of hexdigits to the binary representation of the digits
That was the first thing I gave him... convert from hex to int... he doesn't want it...
Talula
lol
Talula
He should have said so lol
Talula
I gave him in C++
Ludovic 'Archivist'
He should have said so lol
Well, communication with that sort of people is a skill on its own
Dima
God be like “I gave them c++ and they use javascript”
Ludovic 'Archivist'
God be like “I gave them c++ and they use javascript”
That is why I pray to the statues of Richie and Stroustrup every morning
Ludovic 'Archivist'
I pray to them and gift the salt of my morning sc2 game
Abhigyan
God be like “I gave them c++ and they use javascript”
Humans didn't want to waste that precious gift, so they brought emscripten into the game
MᏫᎻᎯᎷᎷᎬᎠ
Abhigyan
The straightforward way is to convert it first into a decimal then to a hex
yeah with strtoll(), that should be pretty easy, but with only 18 digs precision
Ludovic 'Archivist'
Abhigyan
Infint may help though
Anonymous
Because it has been created for professionals
bullshit; also even if it was, I dont think its bad to learn a piece of software
Anonymous
Recommend the book of thread?
Dima
You can find links to your the most favorite books in #rules
Anonymous
Very funny
Ludovic 'Archivist'
Very funny
It is not funny bro
Ludovic 'Archivist'
It is literally our answer
Anonymous
Is funny yeah
Dima
Anonymous
Ludovic 'Archivist'
Is funny yeah
It is not because you would have not bothered people and found "C++ Concurrency in Action: Practical Multithreading" alone like a normally constituted adult
Ludovic 'Archivist'
Aka, a person with minimal autonomy
Anonymous
I want good book recommendations, what's so great about that?