ɴꙩᴍᴀᴅ
ASCII art 🤷
¯\_(ツ)_/¯
klimi
rather go invest in forex bitcoin
klimi
what ads? :D
labyrinth
Hi guys, I have a question; it is well known that for polymorphism, we use virtual destructor to avoid memory leak. Typical example without the virtual keyword for destructor shows that if a member of parent class is a pointer, then the memory on heap cannot be freed. However, how about a typical int member of the parent class. Without calling the parent destructor (consequence of not having virutal destructor for polymorphism), will a typical stack variable be freed?
labyrinth
it is true that no code need to take care of the stack memory management, but the thing is, the end of a class is typically marked as the call of destructor, but without even calling it as a bug under polymorphism, does it really end?
labyrinth
the end of a class instance
labyrinth
i mean, will it happen to be only destructing the child part instead of parent part, if the destructor is not virtual
Vlad
If you don't have virtual destructor
Nils
Is using the result of an assignment expression allowed?
V01D
Hi! Are there any possible chances to make circle diagram on pure c++, that’s what my teacher in university told me to do
https://github.com/ssloy/tinyrenderer/wiki This is as pure as it gets without any external graphics api's
V01D
On pure C++ there's no way to work with graphics
Yes, you could manipulate images such as the example above shows
Anonymous
Pls is there any group for web development
Anonymous
This says C/C++
yh i know C so i am just for a web dev channel
Hassen
Hello
klimi
Hassen
Hi
Thank you
Hassen
I'm new here , I need help
klimi
I'm new here , I need help
Go ahead and ask your query but be sure to read rules if you havent already
Hassen
I would like to get cppbook guide book
V01D
I would like to get cppbook guide book
Klimi just told you to read the rules
Nils
fread(this_kb->event_buf, sizeof(*this_kb->event_buf), 1, this_kb->kbdev); Any idea why this causes a segfault from time to time?
Vlad
It may not be not even this line :P
Nils
It could be anything
solved by recompiling
Nils
Just had to hit the compile button again :P
Vlad
solved by recompiling
By recompiling whole project?
Nils
Vlad
Linker got mad on ya :P?
Mr Xyz
Is this computer knowledge related group.
Anonymous
UB??🧐
Anonymous
ohh!!
Dima
/report
/warn
MᏫᎻᎯᎷᎷᎬᎠ
Like what cases exactly, other than the memory is full?
MᏫᎻᎯᎷᎷᎬᎠ
I've read that the OS do some virtualization processes in case if the memory is full like using the HDD for swapping the unused partitions of your program for later use, which frees some space in the RAM
MᏫᎻᎯᎷᎷᎬᎠ
I think that is how every 30+gb games or heavy softwares are handled
MᏫᎻᎯᎷᎷᎬᎠ
Yes it's outside of the scope, but has an affects for C++ runtime whether to throw std::bad_alloc or not
MᏫᎻᎯᎷᎷᎬᎠ
Patterns like what?
MᏫᎻᎯᎷᎷᎬᎠ
Okay Thanks
MᏫᎻᎯᎷᎷᎬᎠ
/report
OZAIR
/get cbook
OZAIR
/get cbookguide
OZAIR
/get cppbookguide
V01D
/report
Lol, why
Amj
Lol, why
It was hit while scrolling 😬
Sandro
hello, someone can explain how to "compare" function is called without brackets and args? #include <stdlib.h> #include <string.h> #include <stdio.h> int compare( const void *arg1, const void *arg2 ); int main( int argc, char argv ) { int i; argv++; argc--; qsort((void *)argv, (size_t)argc, sizeof(char *), compare); for( i = 0; i < argc; ++i ) printf( " %s", argv[i] ); printf( "\n" ); } int compare( const void *arg1, const void *arg2 ) { return strcmp( * ( char ) arg1, * ( char** ) arg2 ); }
Sandro
I know is a pointer to a routine in function qsort, but how function qsort can call compare function?
Sandro
I mean the code in qsort to call compare function, thanks
Alex
void func(void (*func_ptr)(int)) { func_ptr(5); //this is your call }
Murat
hello, I'm doing a program. In this program, c# applications are called.
Murat
https://www.codeproject.com/Articles/1236146/Protecting-NET-plus-Application-By-Cplusplus-Unman
Murat
I'm editing this. The program is correct yet I need to detect and prevent memory leaks.
Murat
I don't want the C# application to be accessed via memory. Can you help me?
Gul
Starting 😘😘😍
Anonymous
What will be the logic for digit to word conversion in C++ ?
Anonymous
What will be the logic for digit to word conversion in C++ ?
Ex:- 1047 -> One Thousand Fourty Seven
V01D
Perhaps you can load and read a json file. Like maybe you have one json from 0 -> 10, and another from 10 -> 100, then 100 -> 1000, etc.
V01D
Ex:- 1047 -> One Thousand Fourty Seven
Then just use some conditional statements to figure out which json file should be read
V01D
Or you take a look at nlp, I think that could help. Idk though
J
because that's not a VLA, nor is the warning related.
Vlad
because that's not a VLA, nor is the warning related.
He's using non const int, it's indeed VLA
Vlad
Btw flag for it is -Wvla
Anonymous
Then just use some conditional statements to figure out which json file should be read
I've got one logic but it's taking so much codes again and again. I'm doing this by changing some range of numbers by copy paste.
J
He's using non const int, it's indeed VLA
not in his variant, as he'll never re-enter main, thus, the array will only be initialized once. in the case of any other function - yes, you could have a VLA on the stack.
J
either way - that wasn't even the error he faced. it was not using the array anywhere
J
okay, and when's the variability in that arrays length gonna come in?
Vlad
variable in all caps :P
J
lol
J
and where does 'a' get its value from?
J
do you even understand what a VLA is?
Anonymous
It's probably a GCC extension