Daniele
I have no idea, I don't know C++ and we haven't done even pointers yet
Joesph
Too many explicit words my eyes are burning lmao
Andrei
Not my fault, I just translated
Andrei
Some clues?
Marián
guys guys guys guys
Marián
i have enum from one source like this
Marián
Marián
Marián
(this is not actually enum but defines but nwm)
Marián
what's the best way to assign the formats each to other?
Marián
hashmap came to my mind but that seems to overkill... wubu defines or something?
Marián
Marián
need to do smth like this but feels like waste because it's not dynamic in any way
Dima
Why not? Just make it static
Dima
Well this is cxx, got to make naughty ways here
Marián
hmm okay
Marián
Well this is cxx, got to make naughty ways here
and is there any way i could abstract int / float data managment?
Marián
i have case when data are saved as floats or ints
Marián
you only load them with different method
Marián
tfw telegram doesn't want to send 1/2 of my messages
Marián
well nvm
Marián
i have data saved as both int array or float array
Marián
used same way but loaded differently
Marián
is void pointer good solution?
NXiss7
is void pointer good solution?
Possible, but too dangerous
NXiss7
i have data saved as both int array or float array
Maybe a base class and sub class like Class Val Class Int:Val{ }
Marián
i tohught about templates
Marián
but nvm i've already fixed it by writing my own library
MᏫᎻᎯᎷᎷᎬᎠ
When will C++2a come out?!
jot.rs
Keys for your hashmap are numbers hence you can make an ordinary array like int format[] = new int[1000]; and use it the same way. Just make sure array size is big enough
Artöm
hashmap came to my mind but that seems to overkill... wubu defines or something?
Converter function with switch inside, optional error checking
Anonymous
hello
ned
Thanks... how are you?
Epem
Helloween
ned
Hello, I'm fine and I hope that all of you are fine too. I have a question. By far i know that the maximum index value that an array can have is the max value of the data type used as index; I'm trying to declare the an array of a typedef'ed struct and I want to the index have a million magnitude, example i have an index = 1599999; I share the code at (https://godbolt.org/z/qGEYQg) Alternates: The code is at https://pastebin.com/AR1Rjcc6 compiles with gcc 9.2 with fsan flag, the output is at https://pastebin.com/hPqcrQ4i Q.1 - How to know the max value of the index that an typedef'ed struct based array can hold? PS: I don't understand why of this stack overflow! thanks! [update] : changed the link of godbolt
Igor🇺🇦
didn't understand
What do you do with I in your loop?
ned
What do you do with I in your loop?
ooh.. my bad. the code is for ( size_t i = 0 ; i < index; i++){ foo_s[i].name = nam; foo_s[i].value = val; } updated the link on original question but the problem remain; maybe it's not even possible to index a million magnitude value
ned
Thanks for feedback friends.
MᏫᎻᎯᎷᎷᎬᎠ
jot.rs
When will C++2a come out?!
Not sure if I understand what you are asking, but here is status of support in mainstream compilers https://clang.llvm.org/cxx_status.html https://gcc.gnu.org/projects/cxx-status.html
Pavel
I mean What is the release date of C++20?!
As I remember the standard will be published somewhere in February and then we'll probably wait another couple of years for majority of the features to be implemented in some final variant in the compilers
Pavel
Many features are already supported by major compilers https://en.cppreference.com/w/cpp/compiler_support
The major ones (concepts, modules, ranges library and coroutines) are not also personally for me, I can't use anything from the list until MSVC supports it...
Anonymous
Use constexpr variables, not defines
Daniele
Anonymous
Hi
Daniele
why the playfield gets updated in the if block?
Rohan
I want best study material for c/c++
Daniele
I'm supposed to simply do a check, tetramino is a struct pointer but it seems that if I change stuff in the if block, stuff changes in the playfied
Daniele
How can we know lol?
well I thought the if block only checked for conditions, not actually changed any value
Rohan
Thanx @MissRose_bot hehehe
Daniele
Maybe because you do ++?
well I want to check for the next value of the variable pointed, not the current one
Daniele
hold up i'm stupid
Daniele
thanks
Anonymous
++ changes values
Daniele
yes I somehow forgot the basics
Daniele
thank you very much, I was stuck on this for much longer than I want to admit
Daniele
++ changes values
is there a more elegant way to make those ifs?
Anonymous
Idk, you probably need to change the way you write code But maybe it's early for you now Just extract this piece of code to function returning bool
Igor🇺🇦
is there a more elegant way to make those ifs?
What exactly are you trying to check here?
Francisco
When will C++2a come out?!
I think there's a meeting around march/april, in which the commitee will release the final version of C++20
Francisco
I mean, we already know which features are going into C++20, but that's the official release
jot.rs
I recommend you not to use ++ operator in conditions
Daniele
but I have to deal with pointers which are a bit of a grey area for me, I really haven't studied those yet (as well as structures)
Anonymous
why so?
It's less error prone... More readable...
Pavel
why so?
https://stackoverflow.com/questions/42388077/constexpr-vs-macros
Anonymous
https://stackoverflow.com/questions/42388077/constexpr-vs-macros
Oh thanks I was googling with wrong request so i couldn't find anything meaningful