Anonymous
If you don't care for previous values consider using swap on values
swap(mp["hi"], mp["hello"])?
Anonymous
So, the vectors get swapped. Oh!! Why didn't that come into my mind?
Igor🇺🇦
Yes. https://en.cppreference.com/w/cpp/container/vector/swap2
Andrei
I have an class iterator inside my class. My class have a struct inside, used to store data. class iteretor should be able to override std::cout to print the struct inside my class
professor
how can I force to my own program giving more stack `_declspec(noinline) int old_main(int argc, const char* argv[]) { ` using the args from old main?
Joesph
Did i missed something? @K11M1 looks like you purged something
Artöm
Wym how
Andrei
Wym how
operator<<(os_stream, class, iterator)?
Artöm
Yes
Yakov
Not a question, just wanted to show off. I just got max grade at my C++ exam (program engineer student in university)
Artöm
Well done
Nameful
Why is Rose called UwU?
Anonymous
UwU
Joan
https://github.com/jalbam/c_games
Anonymous
Omfg do you really need a 5 minute tutorial on the fucking ternary operator
Anonymous
Just read it off somewhere
Anonymous
I_Interface
@Neko_cpp :D
Anonymous
Hello programme's!
Anonymous
/warn ad
Joan
nice
Thanks
Seiryu
Thanks
Doraemon == Nostalgia
Сарвар
#include <stdio.h> #include <stdlib.h> int main() { char s[100]; scanf ("%s",&s); if (strlen(s)%2!=0) { for (int i =strlen(s)/2; i < strlen(s)-1; i++) { s[i]=s[i+1]; } s[strlen(s)-1]='\0'; } printf ("%s",s); getchar(); return 0; }
Сарвар
what does this code answer? s[strlen(s)-1]='\0';
Anonymous
what does this code answer? s[strlen(s)-1]='\0';
It deletes last symbol of string basically
Сарвар
Thank you!!
Igor🇺🇦
Just want to point out that you shouldn't use strlen all the time. It goes over the string every time. Just store it in a variable. The length doesn't change here
Dero
hi guys
Dero
i'm here 'cause i really need help on a project i'm doing now, i'm stucked on a function that may be a recursive way to create an AST of a parentesis in a algebraic symbolical parser but in practice the parentesis are not correctly linked with the function_linker and if the parentesis is something like (( x + y ) * b ) It just get stucked
Dero
that was a pastebin :/
Anonymous
klimi
I love it
klimi
that was a pastebin :/
Dero: ALGEBRA.HPP https://hastebin.com/pebujezoti.php DEBUG.HPP https://hastebin.com/rukemodopi.cpp TOKENIZIATION.CPP https://hastebin.com/xubowusoqo.php TREELINKING.CPP https://hastebin.com/ijepanigaq.php MAIN.CPP https://hastebin.com/gawuhopeni.cpp for compiling g++ -std=c++17 *.cpp
Anonymous
/warn none of this
Anonymous
what the.
Read the rules Turbo C++ is forbidden here
Anonymous
Nope
Yep, I was wrong
Anonymous
It null terminates the string.
But this statement actually is meaningless
Anonymous
Is there a way to encode strings in C ++ And protect it from hex editor ??
Anonymous
Just Use obfuscate
Igor🇺🇦
Is there a way to encode strings in C ++ And protect it from hex editor ??
I didn't try this method but people say it works https://www.codeproject.com/Articles/502283/Strings-Obfuscation-System
Artöm
Dev is not a compiler
Artöm
And turbo is almost dead
Artöm
/warn none of this
Too harsh man
Anonymous
Too harsh man
Maybe, but still
Artöm
It null terminates the string.
Wrong. String has to be already null terminated to call strlen
Artöm
Is there a way to encode strings in C ++ And protect it from hex editor ??
Plenty. But its impossible to protect it from hex editor, that is, its possible to decrypt it back
NXiss7
It deletes last symbol of string basically
Not really, it just takes null term one char back and it's damn bad code to use. Strlen changes every time, you should hold length in a seperate variable.
NXiss7
There are lots of ways...
Asdew
Is there a way to encode strings in C ++ And protect it from hex editor ??
There is no way to protect a string in a program without depending on user input. Why do you want this?
Pavel
I would say, there's no way to fully protect it, but you still can XOR it to make extracting the values more difficult
Asdew
With or without user input?
Pavel
without, I mean just encode it with a key stored in the app itself it's still easy to crack, but at least some newbie hackers won't be able to do so
klimi
okay sorry... how is this related to c++?
Dima
okay sorry... how is this related to c++?
what if it was written on Qt
Dima
Dima
or imgui
Dima
yeah I am kidding
Dan~
Hi everyone. Is it smart to say that cloud computing has brought C / C ++ back to servers that house high-performance applications? Now that processing is charged per second, I think the more efficient the better and the cheaper to maintain. Except if companies are really willing to have servers full of script running millions of cycles toasting billions like a bitcoin from hell.
Dima
retarded
klimi
retarded
3x ad lol
Dima
take nginx for example
Dima
but these retards with theirs js and python servers… uhhh destroy 'em
NXiss7
or imgui
That's great fun to use btw. 900k static exe with no external (almost) dependencies with UI and crypto.
Dima
meh crypto
NXiss7
meh crypto
Cryptopp vs openssl!