Lounge<C++>

Today we're daydreaming about C++26 reflection
Jan 8, 2019 01:28
So in a binomial heap, insertion is ammortized O(1), thus O(n) for n elements. On the other hand deletion is O(log n), so for n inputs, emptying a heap would be something like ~O( n * log n), right?
Jan 8, 2019 01:22
But emptying.. oh wow
Jan 8, 2019 01:22
And insertion scales with log(n)
Jan 8, 2019 01:22
So I made a binomial heap
Jan 8, 2019 01:18
and I answered myself again
Jan 8, 2019 01:18
list.begin() seems unreferencable
Jan 8, 2019 01:17
After emptying a list
Jan 8, 2019 01:17
Quick question
Jan 7, 2019 21:54
oh duh, nvm
Jan 7, 2019 21:52
Does using list.erase(last_available_element_iterator) do some funny things?
Jan 7, 2019 21:52
But it compared just fine in the previous iteration.
Jan 7, 2019 21:52
Says incompatible iterator types.
Jan 7, 2019 21:51
So I'm getting a crash on comparing an iterator with the .end() iterator of a list
Nov 23, 2018 21:11
quick question
 

C

C stands for Control.
Jun 7, 2018 21:22
Is it a problem with my program or do they lack libraries or something else?
Jun 7, 2018 21:21
And when you manually add those it crashes immediately (likely memory access error or something like that)
Jun 7, 2018 21:21
So when I build my app, it works on multiple machines (that coincidentally maybe all have VS 2017?) but on some other machines it claims missing .dll files
May 31, 2018 23:21
Well, it's certainly feasible, but smart I guess
May 31, 2018 23:21
Not sure if that's feasible purely in SDL
May 31, 2018 23:21
I'm thinking a window with a very modest menu bar and most of the other space reserved for the rendering of the actual GoL grid
May 31, 2018 23:17
I could feasibly make the general GUI with all the necessary options and then use SDL to render the actual game of life, yes?
May 31, 2018 23:14
I'm just starting out, and am honestly more or less new to this stuff.
May 31, 2018 23:11
Any recommendations?
May 31, 2018 23:11
I've been thinking of doing it in something like SDL but I'm not sure if all of it can be done that way
May 31, 2018 23:11
I'm tasked with building a basic GUI for a game of life simulator in C.
May 31, 2018 23:10
Guys
May 28, 2018 02:35
Hllo
Apr 16, 2018 01:28
and swap all the time for what I'm doing
Apr 16, 2018 01:28
well, matrices
Apr 16, 2018 01:28
But in general i do wish to manipulate arrays
Apr 16, 2018 01:28
That's a bad example
Apr 16, 2018 01:26
in a function
Apr 16, 2018 01:26
How would I go about swapping values of a matrix?
Apr 16, 2018 01:21
why avoid it?
Apr 16, 2018 01:06
position being a 3x3 matrix and swap being a predefined function
Apr 16, 2018 01:06
Why would something like this not work?
void up(position* x, int i, int j)
{
swap(*x[i][j],*x[i-1][j]);
}
Apr 15, 2018 18:57
Thanks guys, I see I'd made other mistakes
Apr 15, 2018 17:36
Hmm, I'll try writing it that way in a bit
Apr 15, 2018 17:33
I just don't get how it is semantically different from mallocing for a sizeof node*
Apr 15, 2018 17:28
Hmm, I'm trying to wrap my head around that
Apr 15, 2018 17:26
What do you mean?
Apr 15, 2018 17:25
I'm not sure if my logic is correct. But is this how I should go about it:
1. When a node is created, new_node->children = malloc(n*sizeof(node*))
2. for(i = 0; i < n; i++) new_node->children[i] = NULL

and then when I want to add a new element

3. new_node->children[i] = malloc(sizeof(node)) ?
Apr 15, 2018 17:21
But I get crashes and a lot of problems with malloc, setting the pointers to null, and then trying to malloc specific addresses
Apr 15, 2018 17:21
I need to make a n-ary tree where n is dynamically defined, so I made a structure that contains a "struct node** children" since I want to allocate n pointers
Apr 15, 2018 17:19
lol
Apr 15, 2018 17:18
Need some input
Apr 15, 2018 17:17
Hey all
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Mar 30, 2018 19:27
begginning to think it's just a bad quicksort lol, it's not that indices aren't within relative order, they are being merged/eaten up
Mar 30, 2018 19:14
Not gonna bug you anymore :)
Mar 30, 2018 19:14
Seems I gotta use merge/heap