March
love you
asymtrc
Hey guys , how the string concatenation works under the hood ? "+=" operator , does that allocate memory of existing chars + additional and then copy pervious with additional to new memory address ?
\Device\NUL
First it checks if the space is still available from previous allocation, if yes then it just concat into it
March
❤️
asymtrc
Conforming to performance, unused/wasted heap memory is prefered because we want to avoid system call as much as possible
Hmm, thanks. Another question. Does it mean , that all the pervious memory allocation addresses stored under the hood to reuse them ?
Tommaso
can anyone advise me the best way to detect the deadlock in philosophers dinner in c? I know it could be avoided but it is deliberately induced because of a project
Tommaso
HOOS
Can anyone help me, in Digital signal processing DSP in c/c++, and audio processing trying to start on concept but i always find advanced coding, is there any resource beginner friendly?
Doreece
Hi. I wanna return a char* [ ] from a function . Does anyone have any idea how to do this ? I'll get an error for the return type of function.
Elfa Metesar
because return type can't be char[], it should be char* or char** if it's two dimensional. you also can't return a char* directly unless it's heap allocated or passed as an argument, because of the lifetime of it
Anonymous
Hi. I wanna return a char* [ ] from a function . Does anyone have any idea how to do this ? I'll get an error for the return type of function.
You can't return arrays from functions. You either have to return a pointer to the array or a pointer to the first element of the array. Like the previous user said, you have to be careful about lifetimes when you return pointers.
Doreece
Thanks from both of you 🤝
Anonymous
Hey what's up
08
guys when i print memory address the output is 7f7be9d2e9 without the 0x why , i am using gcc compiler
08
guys when i print memory address the output is 7f7be9d2e9 without the 0x why , i am using gcc compiler
#include <stdio.h> int main() { int myAge = 43; printf("%p", &myAge); return 0; }
Elfa Metesar
ye it shows the 0x for me, idk what compiler xcode uses but it's its own internal console
mazunki
how %p is displayed depends on which libc you use, since that's who implements printf
March
You are missing two files, this is why the hack cannot work 1) d3dx9math.h 2) driverh
March
how to solve it
klimi
how to solve it
Just give up
Tommaso
Hi all, while executing a code the command prompt line appears (I don't know why), the curious thing is that if I click ctrl+c before its appearance the SIGINT handler does its job correctly, otherwise it does not work. Has anyone ever had my same problem?
Guillermo
can you paste the code somewhere? (pastebin)
Guillermo
without the code, I don't know how to help you
Tommaso
It's still under development and a lot of things are untested, I'm aware of that, but this one from the handler I'm trying to fix now https://pastebin.com/wzWmhj8q
Anonymous
I need some one who can scrape and make strong bot
Anonymous
I need some one who can scrape and make strong bot
When bots started becoming strong(maybe it's the gym)
Lodovico
Hi anyone working with directory_iterator ?
Lodovico
Hi anyone working with directory_iterator ?
When I use directory_iterator it opens a handle to file (on each entity) in my handle table I want to prevent that
Xyz_786
Hi everyone.. I'm new here . I learned some concepts of c++ but I want to learn oop suggest me best tutorial & practice & reading stuff as a beginner
jurassic
This code is from TCPL, 4th edition, 32.5.6: vector<string> vs {"Breugel","El Greco","Delacroix","Constable"}; vector<string> vs2 {"Hals","Goya","Renoir","Turner"}; copy(vs.begin(),vs.end(),vs2.begin()); // OK uninitialized_copy(vs.begin(),vs.end(),vs2.begin()); // leaks! My question is why there would be leaks with uninitialized_copy. Wouldn't it rather be overflow of the buffers in vs2 as vs's elements need bigger buffer ?
jurassic
Because you are not destroying the memory occupied by the original strings when you use unitialized_copy. So the memory allocated to store the contents of the strings originally in vs2 will be leaked.
It is only a leak if the original vs is not accessible after the copy. As it stands, there is still a chance to clean up vs, right even though that's not included in the code snippet. Also, the essence of uninitialized_copy, being a templated function, in this example will resolve to: new(&*vs2_iter) string(*vs_iter) This kind of low level buffer manipulation is what led me to think it will be more like buffer overflow rather than leak.
HENIL
I want to learn stl in c++.. where do i start from or any other tips ?
Rakesh
https://hastebin.com/share/upupesiyej.perl I wrote a code for bankers algorithm. I am getting a wrong output for needed allocations
Lodovico
Is anyone working with signalR client in c++ ? I'm trying to keep the connection persist but i have no luck for a proper way ! At the moment im using the simple do {}while(true); Thanks
Ighor
Are you done with this? doc.qt.io/qt-6/gettingstarted.html
Lodovico
You are working with C++/CLR right?
No. I'm working with signalR client c++ https://github.com/aspnet/SignalR-Client-Cpp
The
No. I'm working with signalR client c++ https://github.com/aspnet/SignalR-Client-Cpp
Y do you need to persist connection explicitly? Just follow the example in this
Sam
/start@MissRose_bot
The
Have you tried this?
No but I have a little understanding of this field.. send your code snippet i can look through it..
The
From their API it seems connection persists till you call stop, unless you doing something bad in between
Ludovic 'Archivist'
First Intelligence
Xup guys
Lodovico
Ибраги́м
https://www.youtube.com/watch?v=fJvPBHErF2U
.-.
HI.
.-.
I NEED HELP.
.-.
IT IS URGENT AND I CERTAINLY NEED SOMEONE TO ANSWER ME AS QUICKLY AS POSSIBLE, I ONLY HAVE 3 HOURS.
.-.
¿Alguien habla español?
.-.
или русский?
.-.
what's your question?
THANK YOU VERY MUCH.
.-.
what's your question?
I need your help to finish my code, I literally only need to make 2 things work inside the program to finish it.
%Nikita
I need your help to finish my code, I literally only need to make 2 things work inside the program to finish it.
can you tell what exactly isn't done yet in your program? Maybe I have some ideas how it can be implemented
.-.
I need your help to finish my code, I literally only need to make 2 things work inside the program to finish it.
I am extremely desperate and all my qualification depends on this program, I have been looking for help for hours and nothing. I would really appreciate it if you could send me a DM or review my code here in case you can help me.
.-.
can you tell what exactly isn't done yet in your program? Maybe I have some ideas how it can be implemented
Of course, my program is about registering a library. How can I send it to you?
.-.
through dm I think
Thank you very much.
Lodovico
I'm Posting data about 1mb json and it takes 20 seconds to send to my server ! a = WinHttpSendRequest(hRequest, NULL, 0, NULL, 0, str.length(), 0); b = WinHttpWriteData(hRequest, str.c_str(), str.length(), 0); //Takes 20 second ! c = WinHttpReceiveResponse(hRequest, NULL); #winhttp
Lodovico
Need help
Guillermo
you should launch a wireshark between your host and the server and see the timings
Vishnu
ChatGPT is a life-saver
Guillermo
I doubt the problem has to do with C++
Vishnu
Q. Write a c++ program which converts upper case string to lower case and lower case string to upper case Solution #include<iostream> #include<string> using namespace std; string toggleCase(const string& input) { string result = input; for(char &c : result) { if(c >= 'A' && c <= 'Z') { c += 'a' - 'A'; // Convert uppercase to lowercase } else if(c >= 'a' && c <= 'z') { c -= 'a' - 'A'; // Convert lowercase to uppercase } } return result; } int main() { string input; cout << "Enter a string: "; getline(cin, input); // Use getline to read entire line including spaces string output = toggleCase(input); cout << "Toggled case string: " << output << endl; return 0; }
Guillermo
Need help
look at wireshark :D