Dima
Google what smart pointers are
you look like a googleman
Anonymous
you look like a googleman
Google your momma
Dima
Google your momma
I thought you would suggest yandex.. yandex-boi
Ajay
What are you trying to achieve in first place? This code smells
Oh. This was a shortened version of Trie data-structure. so I had to remove the extra "bit and pieces" from the code
Anonymous
Google what smart pointers are
Or you can just read it in Modern Effective C++ by Mayers
Ajay
Anyway can you help in answering those?
Anonymous
Anyway can you help in answering those?
You need to correct all your mistakes
Ajay
You need to correct all your mistakes
did those smart pointers exist before cpp11?
Anonymous
Kinda
Anonymous
In boost
Ajay
😭Considering the code existed before smart pointers ever came in, can you help with it?
Anonymous
No, I don't like old C++
Ajay
Dima
lol
Marián
rofl
Marián
did i really see 'use c#' as a response to smart pointers
Dima
rude.
Dima
*that was sarcastic*
I_Interface
rude.
You are rude.
Igor🇺🇦
?
You question was will it be deleted - yes it will. Or did I miss something?
Ajay
everything created with new is on the heap
The object is on heap and so is the object to which it's member mp is pointing to. Right?
Pavel
The object is on heap and so is the object to which it's member mp is pointing to. Right?
whether the pointer is on heap or not depends on the map implementation. in STL I'm pretty sure it's on heap, but some custom map can theoretically have some buffer (judy array) with small buffer optimization then it can be on stack. but thats super unlikely. never heard of such implementations of map
Pavel
if the object is on heap, its members are on heap also
Pavel
they can't go to stack
Anonymous
👍
Anonymous
If I want to create a Matrix array during the run time. One way is this: class matrix{ int **p; int d1, d2; public: matrix(int x, int y); void get_element(int i, int j, int value){ p[i][j]=value; } int &put_element(int i,int j) { return p[i][j]; } }; matrix::matrix(int x, int y){ d1 = x; d2 = y; p = new int *[d1]; for(int i = 0; i < d1; i++) p[i] = new int[d2]; } Are there any option
Anonymous
?
Dima
by doing ‘= new ..’ you are allocating on a heap
Dima
creating a fixed stack can be better, like int a[4][4];
Dima
or pass amount of matrix rows/columns from template
Anonymous
but i know the size of the matrix during the running time
Dima
egor
what to do if it says: "DWORD Hackprocess::GetModuleNamePointer(LPSTR,DWORD)": it is impossible to convert argument 1 from "const char (11)" in "LPSTR"
egor
Help
Nomid Íkorni-Sciurus
Hello, I'd like to process a MIDI file to a WAV. I have the samples waveforms in signed bytes. I guess I have to read the note metadata, apply wave transformations (and I guess resolution depends on the lowest bitrate) and then write the resulting wave into the file?
klimi
egor
Google translator translates text poorly
egor
Hi
Hi
Noor
got addicted to that convention after looking at UE4’s code
Man its beautiful and clear, are there people that rewrite std library with that convention?
Dima
I think it’s just different taste
Cyber9ja
Hello house, I'm Jubril, C++ program beginner Whenever I try to run a program on eclipse, it will return ''Binary not found''. Please what can I do? Thanks
Nameful
return m_classMap[cls] = [[[JSObjCClassInfo alloc] initForClass:cls] autorelease];
Nameful
What do the [] brackets mean here, seeing as they are at the beginning of assignment?
Cyber9ja
Hello house, I'm Jubril, C++ program beginner Whenever I try to run a program on eclipse, it will return ''Binary not found''. Please what can I do? Thanks
Anonymous
Nameful
is it C++?
It's located in a .mm file, and from what I understand that indicates C++ for an Objective C compiler
Nameful
But yeah, it doesn't seem like C++
Nameful
https://stackoverflow.com/questions/10335285/c-language-what-does-the-mm-extension-stand-for
Anonymous
Pavel
It's located in a .mm file, and from what I understand that indicates C++ for an Objective C compiler
objective C/C++ is not C++ square braces mean method call in objective C as far as I remember
Nameful
All right, thank you
Anonymous
Divyanshi
How to store a 16 bit integer in cpp ????
Divyanshi
int16_t
Is it an alias for unsigned short?
Anonymous
How to store a 16 bit integer in cpp ????
#include <cstdint> uint_least16_t
Anonymous
Is it an alias for unsigned short?
unspecified = implementation defined
Divyanshi
Sorry I didn't get you
klimi
Sorry I didn't get you
https://www.cplusplus.com/reference/cstdint/
Anonymous
Sorry I didn't get you
it is not known, but int16_t, if available, MUST have exactly 16 bits
Anonymous
Is it an alias for unsigned short?
int16_t has exactly 16 bits short has at least 16 bits
Divyanshi
Owwwh
Divyanshi
Got it... Thank you so much