Pavel
Why does it say pre C++11 undefined ? Does that mean it's not undefined in C++11 and onwards?
I see it says just undefined behavior, or what part are you referring to? i = ++i + i++; // undefined behavior
Anonymous
Why does it say pre C++11 undefined ? Does that mean it's not undefined in C++11 and onwards?
Some of these examples have been well-defined due to the rule changes in C++17 while others still remain undefined.
mito
I see it says just undefined behavior, or what part are you referring to? i = ++i + i++; // undefined behavior
The heading. Pre-C++11 Definitions Pre-C++11 Rules Pre-C++11 Undefined Behaviour ...
Go sleep
Is there a c++ bot for tg
رغد🖤
Is there a c++ bot for tg
I want one either
Danya🔥
Is there a c++ bot for tg
What is a "c++ bot"?
Go sleep
That i can program in telegram
Danya🔥
You do not make any sense I'd suggest to address your questions to ChatGPT from now Maybe the machine will be able to understand you
Go sleep
Bruh
Go sleep
U not very nice
Pavel
That i can program in telegram
The telegram API and UI would make programming through a bot a terrible experience. It is better to download some C++ compiler app (there are multiple for Android and I expect should be for iOS)
Pavel
Telegram is just not designed for that
Sid Sun
well.. there is this
Danya🔥
U not very nice
I'm not supposed to be
Chat Boss
Aze sent a code, it has been re-uploaded as a file
Anonymous
Hi, guys how many times the function getline(); can it be called within a loop structure to read a string? I'm trying to read a struct with two members a string name and an array age both with length 2. When I execute the reading inside the for getline(cin,p.name[i]); it is once name and age but the second time it no longer reads the name just the age is how it skips up on the second iteration.
Elfa Metesar
cin.clear(); cin.ignore(10000,'\n');
Anonymous
I am seeking for the site that provides free courses along with the certificates..
Anonymous
do you guys know some.?
Danya🔥
Certificates mean nothing
𝘞𝘦𝘢𝘳𝘪𝘯𝘨𝘔𝘦𝘥𝘢𝘭
hey, is there a way to hide the output from execlp? I'm trying to pipe the output of a command to another and then read the result, but I only get the result on the terminal. I don't want this behaviour, I want that the second command runs and I get the output in a string, is it possibile? code: https://pastebin.com/5Mzr8eYa
Anonymous
Given that each sub-array has exactly 3 elements, element access can be done like this: for (int i = 0; i < 9; ++i) printf("%3d\n", arraysArray[i / 3][i % 3]); Also note that there are only 9 elements, so the end value of i should be 9.
𝘞𝘦𝘢𝘳𝘪𝘯𝘨𝘔𝘦𝘥𝘢𝘭
Elfa Metesar
I can't do this with popen: man man | col -b
int main() { FILE* cmd = popen("echo oki | grep -o 'i'", "r"); char output[256]; while(fgets(output, sizeof(output), cmd)) { cout << output << endl; } return 0; }
Elfa Metesar
this redirection in popen works for me
Elfa Metesar
i can't send ss
𝘞𝘦𝘢𝘳𝘪𝘯𝘨𝘔𝘦𝘥𝘢𝘭
this redirection in popen works for me
can you do this test pls? popen a "man man | col -b" and send me the hexdump -C of it
𝘞𝘦𝘢𝘳𝘪𝘯𝘨𝘔𝘦𝘥𝘢𝘭
I should have fixed
Ighor
The message was posted today
I see, so he possibly quoted that old message, and the bot quoted to answer
Mustafa
I want to develop a tetris game in c, which libraries do i need for making that? Ncurses? Sdl? Allergo? I don't know which one has the best functionality and mobility for graphic games?
Mustafa
I need someone to answer this😐
Pavel
I want to develop a tetris game in c, which libraries do i need for making that? Ncurses? Sdl? Allergo? I don't know which one has the best functionality and mobility for graphic games?
SDL2 should be good for purposes of writing small games from scratch (in C or C++), it is not overly complex for simple games but supports doing complex stuff as well. It is crossplatform. It has good tutorials and many users.
Gawr
Raylib is also a good choice. It provides cheatsheet for all apis and in my opinion it is easier to use than SDL.
Melvin ♣️
does anyone have c++ book in english
Pavel
Do u know a good source for SDL tutorial in c language? I only could find in c++
Hm, not sure, I was using it with C++, I would guess it should be relatively simple to rewrite examples from lazyfoo to C from C++, I don't think he uses some complex C++ features in his examples
Ali
Plz Resolve my issue: https://github.com/leostratus/netinet/issues/1
Ali
Plz Resolve my issue: https://github.com/leostratus/netinet/issues/1
Redefinition of struct in bhot these libraries. For more error detail plz visit git issue
ゾロ
guys, I am new to makefile and I come across a makefile that with many "makefile variables ", I want to replace those variables with the actual value, how to do that
Anonymous
Redefinition of struct in bhot these libraries. For more error detail plz visit git issue
If this code is not owned by you then you should raise an issue with the library author. You shouldn't be using linux/in.h at all in your code. That is meant only to be used within the kernel.
Sourish
Anyone Know How To Handle Wamp Server..??
Hritik
I have a question Suppose we have a multiset of string Now I'm iterating over the set as for(string s: set){ Now if i delete all the elements within the set so in the next pass it is throwing an error } How can I fix it
Elfa Metesar
for (auto it = a.rbegin(); it != a.rend(); ++it) { a.erase(*it); } I used reverse iterators here because for some reason set returns a contant iterator if it's not reverse, it does the same thing anyway
Elfa Metesar
oh, you used multiset, well the same logic with it
Chat Boss
Hritik Kaushik sent a code, it has been re-uploaded as a file
Hritik
im getting this error AddressSanitizer: heap-use-after-free on address @elfametesar
Elfa Metesar
hold on
Elfa Metesar
im getting this error AddressSanitizer: heap-use-after-free on address @elfametesar
lol maybe this isn't safe, cuz it's fighting me. when i use const iterator and delete the item, it's bad access. when i use regular iterator, it's the same. it only throws no error when i use reverse iterator but it doesn't remove properly, only 2 items out of 4
Elfa Metesar
i mean i guess it shouldn't be safe since you're iterating through indexes and once you delete an index or insert an item, you break the hierarchy
Elfa Metesar
maybe it would be safe to delete/insert using simpler types of containers, but since this is somewhat ordered, it poses a risk is what i think. idk tho, im not really an expert
Hritik
actually i was trying to do something like a dfs here
Hritik
so i dont pickup same element in the same path again i was removing it from the set
Elfa Metesar
so i dont pickup same element in the same path again i was removing it from the set
idk, i might be wrong on how i go at it, i remember seeing in a tutorial about this specific thing where you wanna delete items while you're iterating through them, and i remember seeing the guy use iterators in for loop, but maybe i misremember it. ill check it out
Elfa Metesar
Hritik
because the strings should be sorted if multiple path exists
Elfa Metesar
i figured you needed sorting lol
Elfa Metesar
that's the kinda thing that kinda ruins the for loop deletion thing for you ig
Hritik
instead of deleting i will try to keep track of visited string maybe that will work
Elfa Metesar
yeah
Chat Boss
for (auto it = a.rbegin(); it != a.rend(); ++it) { a.erase(*it); } I used reverse iterators here because for some reason set returns a contant iterator if it's not reverse, it does the same thing anyway
Madhu sent a huge message, it has been re-uploaded as a file It should be for (auto it = a.begin(); it != a.end(); ){ //If elem must be deleted ..
Dima
lol
Anonymous
yeah, but it still doesn't matter, because sets and maps don't work that way
The point was that your code is wrong and I was saying why it is wrong. And why do you think you will not have such a use case? Deleting some elements at a stretch from a container (be it a map) seems to be a valid use case
Anonymous
lol
Yeah. I was pissed off too. Maybe an exception can be made for admins 😉
Elfa Metesar
The point was that your code is wrong and I was saying why it is wrong. And why do you think you will not have such a use case? Deleting some elements at a stretch from a container (be it a map) seems to be a valid use case
i don't remember saying there was no such use case, of course there is. ik my code was wrong, i kinda played around after that and made some adjustments. i just couldn't get that working with sets and maps, and i assume it's the way their items are aligned
Ludovic 'Archivist'
Plz Resolve my issue: https://github.com/leostratus/netinet/issues/1
Tell whoever uses linux/in.h to stop and to use netinet/in.h, one is portable the other is not
Shaonianan
hi guys,I want to custom deleter, but is error when i want two para:
Shaonianan
class Test { public: Test() { cout << "Test()" << endl; } ~Test() { cout << "~Test()" << endl; } }; class Deleter_ { public: void del(Deleter_ &d, Test *p) { std::cout << "Deleting ..." << std::endl; delete p; } }; int main() { std::shared_ptr<Test> spTest; spTest.reset(new Test(), std::bind(&Deleter_::del, &d, _1));}
Shaonianan
somebody help me? thank you guys..