Mihail
With '\0'
Mihail
Because it's printing 30 random chars I think
Mihail
So just stringf[t] = '\0'; after the for
Gianmarco
so for {....} stringf[t] = '\0';
Mihail
Yes
Gianmarco
It worked!
Mihail
Nice
Mihail
Idk why I didn't think of that earlier tho
Mihail
I'm too used to std::string I guess
BinaryByter
probably because you didn't have the full picture
BinaryByter
its really hard helping people who don't give you context
BinaryByter
(to be fair, gianmarco did do all he could)
Mihail
Well you could've known that was wrong with just the function
BinaryByter
but its hard to read into others peoples code
Mihail
But yeah seeing it in such a way made it more clear
Mihail
Mihail
Because he just initialized a buffer of 30 bytes(chars)
BinaryByter
No
Mihail
And modified that
BinaryByter
notice how the 3 first bytes ARE set
Mihail
BinaryByter
Mihail
BinaryByter
his error implies that there are special chars in between C D and E
Mihail
That's the length of string
Mihail
Not stringf
Mihail
They aren't necessarily the same
Mihail
And scanf terminated the input one for him
BinaryByter
Well yes
Mihail
So the for only ran 3 times
BinaryByter
anyway, whatever
Gianmarco
i tried to use the function for print into a file
Gianmarco
but i have this printed
Gianmarco
C /Ôm D :tû E /Ôm
Mihail
Idk why that happened
Gianmarco
Oh wrong .exe
Gianmarco
my bad
Gianmarco
it works!!
Mihail
Nice
Mihail
Got confused for a bit
Anonymous
Mihail
Mihail
We aren't here to do your homework
Mihail
Or assignment
Mihail
Also that's way beyond simple
BinaryByter
Gianmarco
Honestly i thought that i could copy ONLY the string that input and it wouldnt autofill
Mihail
You could modify the input one if you want
Mihail
So all the modified variables aren't necessary
Mihail
Unless you need them later on that is
Gianmarco
Thanks for the help
MᏫᎻᎯᎷᎷᎬᎠ
If rvalue can't appears in the left hand of the assignment
Then Why this expression is valid:
int&& r = 1;
Dima
MᏫᎻᎯᎷᎷᎬᎠ
loool
Don't mock my dumbass xD
BinaryByter
we don't
Dima
int&& = 1;
BinaryByter
its just that those are pretty ridiculous things to ask xD
BinaryByter
BinaryByter
why is
int&& r
an rvalue?
BinaryByter
Like... I wouldn't call it one
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Then..
MᏫᎻᎯᎷᎷᎬᎠ
In the move constructor
MᏫᎻᎯᎷᎷᎬᎠ
int&&
MᏫᎻᎯᎷᎷᎬᎠ
What?!!
BinaryByter
what is
int**
?
BinaryByter
yes
BinaryByter
what is
int&&
?
MᏫᎻᎯᎷᎷᎬᎠ
You mean reference to reference?
BinaryByter
yes
MᏫᎻᎯᎷᎷᎬᎠ
yes
So as a parameter it's not a reference to reference
MᏫᎻᎯᎷᎷᎬᎠ
+
MᏫᎻᎯᎷᎷᎬᎠ
Why would reference to reference can be initialized to a literal?
BinaryByter
if you make it const
BinaryByter
show me them codes