Gradus
Hi piple
Gradus
Help me rabits
Dima
No
Dima
😜
Gradus
Need to write lists
void
Need to write lists
Lists of?.. 🤔
Gradus
In programming c
void
struct list { int *data; uint16_t cap; uint16_t size; } Profit
Gradus
It includes add del search list
void
Add: list->data[list->size++] = num; :d
void
It includes add del search list
Search — linear if list isn't sorted, binary if sorted
Gradus
Don't you get much of it?
void
?
Gradus
Да блин
Gradus
Как жи сказать то
Dima
Anonymous
😏
James🤍
Hey.. Am new here
Anonymous
click here to prove you're human
Anonymous
hi, guys. which vs version are you using ?
Dima
CLion
Anonymous
Click here to prove you're human
Jussi
If I pass a param as a value to a function in C++, can I simply use std::move to not create unnecessary copy of the value? I don't need the value anymore in the callee
Anonymous
http://this.is-a-professional-domain.com/6F86Ua3.png
Anonymous
How to debug a shader that isnt binding/being executed
Anonymous
It compiled fine
Anonymous
aswell i did glUseProgram(id)
I_Interface
Jussi
CLion is shit
I_Interface
Anonymous
vc2019 is slowly, how to tune it to make it as fast as vc2008?
I_Interface
Nikolas
ok no 😆Just poorly worded message sorry 😆
Dima
/warn Enjoy our warn park
Anonymous
#notename
Anonymous
Hy soma
Soma
Hello
Anonymous
Hello
How are you
void
void
How this works??
Soma
How are you
Cool...n u??
Anonymous
Mihail
can anyone review this code? and can it be optimized more? https://pastebin.com/t4tBMP1A
1. Don't use the C header files (ending in .h ) in C++. Use the C++ version of those. 2. You're including headers you don't even need. 3. Lines 23 and 24 are exactly why do while exists. 4. using namespace std; 5. Line 39, 40 and 64 are why for exists. 6. Why are you passing NULL to strtok on line 37? 7. The if's could be replaced with a switch
Soma
Thanks... I have some knowledge...but this blew off my fuse
Soma
@TinkuBanna can u look into it
Anonymous
@TinkuBanna can u look into it
Yes but I don't know
Anonymous
BinaryByter
1) Don't use compile time arrays, they will fill your heap space up. 2) don't read a full line at once, because it will make you do the parsing twice 3) You can do the parsing recursively because you know that if there is something after the second operand, you have a second equation. do something like this: a + b if after b, you have another operation, you evaluate a + (b + c) for example that way, you don't even have to store the numbers, meaning that you will be less likely to fuck up and you won't even have to use the std::vecto
Mihail
Would be better
Soma
@BinaryByter @mmihov sry for being intense... Can u help??
BinaryByter
@BinaryByter @mmihov sry for being intense... Can u help??
ask us what you dont understand, instead of telling us that you don't understand it
Mihail
>2. You're including headers you don't even need. Wait, aren't you the guy who thinks that compilers are spotless at optimizing?=
No I'm not and even if they were that doesn't mean you should include every header file you've heard of
Soma
ask us what you dont understand, instead of telling us that you don't understand it
Yeah i just told that... Its clear from my question/image that how does scanf works in this case...
Mihail
And it won't increase runtime, but would increase compile time
BinaryByter
and executable size
Soma
ask EXACTLY what you don't understand
Whoa... Ya...how the output is coming in these cases...
BinaryByter
BinaryByter
you probably understand the first one, right?
BinaryByter
reading...😅
Feel free to ask questions 😉
BinaryByter
what about using namespace std?
Its kind of a convention not to use "using namespace std;"
BinaryByter
but its not too big of a deal ¯\_(ツ)_/¯
BinaryByter
Ya..after that none...
So the memory of the char[30] isnt changed after the scanf
BinaryByter
so after scanning in the first time, it scans in a second times
BinaryByter
but it only changes what it has to change
BinaryByter
BinaryByter
Or rather: use an array that is allocated at compile time
BinaryByter
using std::string would be better
BinaryByter
but I HIGHLY suggest, not reading more than a single operand at the same time
BinaryByter
Wait a sec, i'll write you an improved version of this :P