March
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
\Device\NUL
First it checks if the space is still available from previous allocation, if yes then it just concat into it
March
❤️
\Device\NUL
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
thebats
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?
C
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
Doreece
Thanks from both of you 🤝
Anonymous
Hey what's up
klimi
08
guys when i print memory address the output is 7f7be9d2e9 without the 0x why , i am using gcc compiler
\Device\NUL
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
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
klimi
Danya🔥
Lodovico
Hi anyone working with directory_iterator ?
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 ?
Anonymous
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 ?
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.
Anonymous
HENIL
I want to learn stl in c++.. where do i start from or any other tips ?
jurassic
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
Ludovic 'Archivist'
The
Sam
/start@MissRose_bot
Lodovico
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?
.-.
или русский?
%Nikita
.-.
.-.
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
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
\Device\NUL
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
Why using std::string and not primitive c arrays?
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;
}
%Nikita