olli
But like... what could be causing my problem?
MCVE would make it possible for us to figure it out :)
BinaryByter
🤔
BinaryByter
thanks to you
Mihail
you need a begin and an end iterator
Mihail
but you can just use std::array (which has them)
BinaryByter
Nicola
no
And howw
Mihail
therefore v [10] = {0,1,2,3,4,5,6,7,8,9}; random_shuffle(v[0], v[9]);
std::random_device randDevice; std::mt19937 randNumGen(randDevice()); std::array<int, 10> arr = {0,1,2,3,4,5,6,7,8,9}; std::random_shuffle(arr.begin(), arr.end(), randNumGen);
Mihail
i think this will work
Mihail
haven't tested it tho
Mihail
oh and you'll need <random> and <algorithm>
Mihail
You aren't even that active tho
Anonymous
template <int N> struct Factorial { static constexpr int result = N * Factorial<N - 1>::result; }; template <> struct Factorial<0> { static constexpr int result = 1; };
olli
you need a begin and an end iterator
you can use "pointers" as well, and there is std::begin for an array
BinaryByter
>:D
Anonymous
xD
BinaryByter
look at flood fill
BinaryByter
i used it recently
Anonymous
Yep
BinaryByter
look at flood fill
look at fractals
Dima
look at fractals
look at Francis
Anonymous
For recursion or for TMP?
Anonymous
Depending on what you're doing. If I do much TMP stuff, I use recursion (cause you only can use recursion there), but else I don't use it. It's slower and less efficient than iteration, but easier to read.
Anonymous
Some math stuff and some implementations for trees are easier with recursion
Anonymous
But that are rare cases
Mihail
What is it my19937?
random number generator
Parra
What is it my19937?
mesmere twister
Mihail
What is it my19937?
https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine
Anonymous
Yes. What I should note: If you write your recursive function in a special manner, the compiler will try to do tail call optimization. If it works it's great, the compiler will optimize your recursion to a loop. But if that doesn't work your function will spam the stack and will be way slower.
Nicola
random number generator
Thanks , now I try
BinaryByter
lets spam the stack
Mihail
Anonymous
lets spam the stack
"Said webkit-gtk and needed 8MB stack size"
BinaryByter
I know :)
Anonymous
Anonymous
webkit-gtk still don't work with musl. No big loss tbh, but still weird
Anonymous
Hi all
Anonymous
I think that probably I’ll become crazy...
Anonymous
Any ideas why it say ”stack smashing detected”?
Anonymous
Show us the code
Anonymous
But don't you dare sending a photo :^)
Anonymous
Hahahahahaha
Anonymous
But don't you dare sending a photo :^)
In which other way I can show you if not??
j
Franchesco, i like your name written in japanese
Anonymous
In which other way I can show you if not??
Put it here with formating, or if the code is too long, give us a pastebin link.
Anonymous
I don't have time... Can, only for this time, send you a photo?
Anonymous
🙃🙃
Anonymous
I don't have time... Can, only for this time, send you a photo?
No, pasting some stuff at pastebin doesn't take much time
Nicola
[Error] #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
Parra
xd
Parra
the same error tells you the solution man
klimi
End is near!
Anonymous
Nothing... It’s my name... F R A N C E S C O
Anonymous
Hello
14•08
Thank you 😊
Anonymous
Is technical service desk is a software job??
-_-
What is strong logic for reversing a number ? I used this but my seniors saying it now that strong while(number>0) a=number % 10; printf("%d",a); number=number / 10; Any one can tell me strong logic for this ?
-_-
Misteck on 3rd line : It not strong logic***
14•08
14•08
it does not provide correct answer there a logical error i can not solve it😞
14•08
Amean doesn't give exactly Average
Liam
Hey, anyone could help me with this snippet of C++ code? The compiler reports error for no declaration of status, but I think it's visible in the dirved class template. MWE: https://gist.github.com/Liam0205/c7b58df8b97d74ea049c1bd6146b6a19
Liam
Any clues would be appreciated.
Liam
Compile it with -std=c++11, such as g++ -std=c++11 mwe.cc
Liam
Hey, anyone could help me with this snippet of C++ code? The compiler reports error for no declaration of status, but I think it's visible in the dirved class template. MWE: https://gist.github.com/Liam0205/c7b58df8b97d74ea049c1bd6146b6a19
It's fixed. The problem is that status and temper are non-dependent names, which means that they are independent to template parameters. Hence, when they are looked up is not specified in the C++ standard. GCC looks them up at template parsing time, and hence they are lack of declaration. On the other hand, VC++ looks them up at template instaniation time, hence they are well declared. To fix this problem, one is going to make them back to dependent name by this pointer or by base class template field operator base<foo, bar>::. In my case, the following code works: this->status interface::temper
Oneiromancer
Kk
Anonymous
Yes. TMP is great.
Dev
Hello everyone
Greem
How to connect Sql database with c using codeblock
olli
How to connect Sql database with c using codeblock
Depending on your database search for a C library that can interact with it