olli
?
msg * hello does not fit in your char[10] buffer, hence you overflow it
olli
I don't understand
how many characters do you need to store msg * hello ?
Nazarova Muslibar
how many characters do you need to store msg * hello ?
https://www.tutorialspoint.com/system-function-in-c-cplusplus#:~:text=The%20system()%20function%20is,included%20to%20call%20this%20function.
f0xeri
I think u need book, not a tutorial
Nazarova Muslibar
I think u need book, not a tutorial
Yes. I'm learn C++ in Udacity.com
olli
https://www.tutorialspoint.com/system-function-in-c-cplusplus#:~:text=The%20system()%20function%20is,included%20to%20call%20this%20function.
char cmd[10]; +---+---+---+---+---+---+---+---+---+---+ | m | s | g | | * | | h | e | l | l | +---+---+---+---+---+---+---+---+---+---+ => Not enough space to store the whole string warning: '__builtin_memcpy' writing 12 bytes into a region of size 10 overflows the destination [-Wstringop-overflow=] 6 | strcpy(cmd, "msg * hello"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
f0xeri
I don’t understand why but his program works)
f0xeri
.
Anonymous
I don’t understand why but his program works)
You just witnessed the undefined behavior
olli
.
power of UB
f0xeri
Ah ok
布丁
CTF warmup problem #1
:)
hi
Nazarova Muslibar
hi
Hello dear
Anonymous
Yh I don't understand how your program worked
Anonymous
:)
Hello everyone who knows well js?
Nazarova Muslibar
Yh I don't understand how your program worked
it's worked. Strcpy did not give an error copying to the array
olli
it's worked. Strcpy did not give an error copying to the array
please learn about UB, worked does not mean correct
Anonymous
Hey I want to learn c
Anonymous
Please anyone teach me
Dima
lol
Nazarova Muslibar
Please anyone teach me
Congratulations
Anonymous
lol
Anonymous
Fuck off
klimi
Dima cute
Dima
Good evening
klimi
Good evening dima-chan
olli
Yes it's right
your program might work but is not correct, the latest version of gcc even issues a warning. Search the internet for "buffer overflow" and "Undefined behavior" to see what's wrong.
olli
Yes it's right
https://godbolt.org/z/1qe6ve
:)
where to start studying c++
Dima
lol
Renan
I recommend changing your font. 🙂
Renan
Please anyone teach me
How much are you willing to pay? 🤔
Anonymous
How much are you willing to pay? 🤔
Aww come on can't be his mentor
あおい ハート
/get cppbookguide
Renan
/get cookie
Wojak
How would this snipet execute ? std::bitset<4> num(std::string("0100")); num.flip(2); num.flip(0); num.flip();
Wojak
Any help on the dry run would be appreciated. Thanks
Anonymous
Wojak
Yes, But I didn't understand bitset functionality.
Wojak
Ok, stonks!
Anonymous
/get ide
Daniele
guys I have this task I'd like to automate and give a gui frontend to: basically I need to create a symlink to every folder in folder "B" and put it in folder "A". I also want to be able to remove or invalid the symlinks so they don't get loaded anymore by another program. would this better be some sort of powershell script or a full fledged windows c++ program?
Alex
powershell
Alex
you are joking. shell is created for tasks like this. how are you going to create symlink on c++?
Daniele
fact is that it would require making basically a file manager from scratch
Alex
this is overengineering
Daniele
this is overengineering
but a gui frontend would be cool
Daniele
I could share it with other people without too much explanation
Daniele
would also be quicker to use
Alex
this is bad idea, cause your c++ code is harder to support, more bugs and so on
Daniele
that's also true
Alex
create small shell script instead of big c++ project with classes :)
Daniele
also yes, how do I make a symlink in C++?
Alex
learn, do all tasks using c++ not the best idea
Daniele
Daniele
I will consider both options, thanks
Anonymous
yh Best coders use python at the time and c++ for the right job
Alex
happy I do not work with windows guys. hard to imagine someone will use c++ to check symlinks. this is small shell script
Murod
hello, guys! Can anyone give qtLog.dll file? one program on windows 10 requires.
Murod
I found an uncompiled version, who can compile for me? https://sourceforge.net/projects/qtlog/files/qtlog/