Dima
> great ide > lags in large projects never trust yourself
BinaryByter
Is that it sometimes lags in large projects
well. if you put all your stuff into one file
Alignant
BinaryByter
Or you open too many tabs
Why would anybody want to do that?
Dima
need more tabs
Alignant
Why would anybody want to do that?
The same reason people open to many tabs in browsers. I am not sure, I never need more than 7
BinaryByter
Are you getting paid for the amount of open tabs you have?
BinaryByter
dafaq
Dima
klimi
what is this?
Anonymous
BinaryByter
Dima
c++43 standart
klimi
oh
klimi
Dima
a joke
who knows ( ͡° ͜ʖ ͡°)
BinaryByter
let's hope i'll die before c++43 then
Alignant
Alignant
I like this joke better. Though I'm afraid everyone already saw it
klimi
THIS IS BRILIANT
klimi
under what licence is it?
Alignant
under what licence is it?
It's actually written on the map
Ибраги́м
Bader
csharp.exe
i love seeing sharp
hostmit
Hola! I have following code in fucntion myfunc () {int* myArr = new int[3]; } which is being called few times. how do I delete all instances of myArr at once?
hostmit
there wont be access to myArr outside of this function (method). And I dont know how times this method will be called (how many array pointers will be created)
Alignant
Is that a question? :D
Alignant
Do you mean... how to delete the array outside your myfunc() function?
hostmit
yeah.
Alignant
That's the funniest part about C/C++
hostmit
sorry for being unclear
Alignant
You can't :D
Ибраги́м
yeah.
Return, acquire, then delete.
Ибраги́м
Or just RAII things
Alignant
Well, if this fuction returns the pointer, you can. I assumed it was a void function
Alignant
Or just RAII things
Do you mean smart pointers?
hostmit
Esp32 coding... damn void* pointer I have to pass, to another function... unless new - it will be empty by time it will be parsed by recepient.
Alignant
raturning pointers, eww
Well, in C it was like... everywhere
BinaryByter
which is why C++ > C
Marie
which is why C++ > C
which is why C++ < C
hostmit
if I store list of pointers (memmory address) to some class static variable, can I clean later?
BinaryByter
but if you use C++, you should use references
hostmit
can I re-declare new pointer @ known RAM address and delete[]
hostmit
same type pointer
hostmit
*new
BinaryByter
you can just use an old pointer and call the constructor on it again
hostmit
how? it wont be avaliable outside the method.
BinaryByter
you have to pass it
Alignant
which is why C++ > C
Well, you still can do this in C++. That's why people hate C++. It's like goto. Python, for example, doesn't have it. And therefore there's no chance you meet it your life. Nobody in C++ uses goto, but... there's still a chance you meet it.
hostmit
how do I post link to screenshot without breaking any channel rule? :)
BinaryByter
C++ has the mentality of "do what you want"
klimi
just send it
klimi
hmmmm
hostmit
klimi
http://share2.hostmit.net/ss/Code_2018-09-01_22-42-53.png
klimi
ye
hostmit
:477
Alignant
C++ has the mentality of "do what you want"
You can control yourself, but you can't control the others. It means everyone can do what he wants. And sometimes you'll have to read their code
hostmit
so it will be a few those int *myArr.... how do I clean up all? or am I'm missing better way to pass variables as void* pointer?
hostmit
if I pass an array, to handleInterrupt(), on PC compliler there will be data... on ESP (ARduino) everything is 0
Ибраги́м
sorry for being unclear
int* func() { int* arr = new int[10]; return arr; } void fn() { auto acquire = func(); delete [] acquire; }
Ибраги́м
clang++-6.0 -Wall -std=c++14 -fexceptions -fsanitize=address -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error
hostmit
I cant delete it right away... only on demand
Ибраги́м
I cant delete it right away... only on demand
Well, I believe you can tweak the code above
Alignant
Are you sure you have to delete it?
Roxifλsz 🇱🇹
oh man I'm trying to code for esp8266... got any tips?
Just use the Arduino core for doing that, it has lots of compatible libraries and you will not need to reinvent the wheel
BinaryByter
such a long function
Ибраги́м
I didn't see this