Anonymous
Ahh no I see the second error
V
Yeah it is
V
But I'm taking array[ ] which equivalent *array which equivalent reference on the first array's element, and it is mean that I'm taking a reference, which must change. I'm mistaking now, yeah?
Anonymous
Yeah I'm a bit jazzed atm
V
V
I'm panic
V
I remember that if you don't want to change an array you should add const qualifier
V
And I'm confused now
Anonymous
No you're right I think
Anonymous
Is there any other code or is this all?
Anonymous
Cause also when I'm under drugs atm, I can't see a error
V
Ah, and using namespace
Anonymous
And you changed both for loops?
V
One moment, I'll check
V
Oh damn I forgot to change first functiong
V
Sorry me
V
And thank for help
Anonymous
No problem
V
But I have one question yet
V
Why compiler didn't say about overwriting after the finish of the first function?
V
Is it normal?
V
Ah, fine, thanks
Unknown
any good program to implement infix to postfix expression?
Unknown
Nicola
how can I randomly generate a number without repeating and presenting the entire range? For example
for(i=0;i<10;i++){
j=rand()%10;
cout<<"-"<<j;
}
and I want -2-1-4-5-7-8-6-9-3-0
Dima
check if that number exists in your array
Nicola
to avoid repetition?
Parra
Nicola
use set
what function is it?
Parra
std::set
Parra
or use an array and do random permutations
Parra
with swap
Anonymous
who will show me best map
Anonymous
Swap full form ??
Nicola
std::set
what does "set" do?
Dima
well. basically it’s a set..
Dima
Anonymous
what is the library for shiftnig
Anonymous
shifting
BinaryByter
Dima
shiftnig
Parra
or maybe std has a method for random distributions over array
Parra
check cppreference
Anonymous
what is important for game making
BinaryByter
V
Anonymous
Anyone here do video and audio development
Anonymous
How to grab all about it not just using ffmpeg
Anonymous
but know how to handle the business behind video and audio so you can programming with whatever other libs for it
Parra
for example:
Parra
for (int i = 0 to num_elements) {
array[i] = i;
}
for (int i = 0 to num_permutations) {
left = random(0 to num_elements - 1);
right = random(0 to num_elements -1)
swap(array[left], array[right]);
}
Parra
this is a way of doing it
Parra
it's just pseudocode
Parra
another is:
Parra
set<int> s;
while (s.size() < num_elements) {
int value = random(0 to num_elemrnts -1);
set.insert(value);
}
Parra
this is another way of doing it
Parra
both are not optimal but may work
Parra
set holds unique values
BinaryByter
how do these variables work that only have a "." in front of them?
BinaryByter
ive never seen them
BinaryByter
and they are highly disturbing to me
BinaryByter
olli
Designated initializers will be part of C++ 20 or available via C++ Compiler extensions.
This form of initialization is part of the C99 standard, so several C++ compiler probably support it as well
BinaryByter
how does it work?
BinaryByter
what does it do?
olli
Assign to the members of a struct by using their names.
e.g.
struct A { int x; int y; int z; };
A b{.x = 1, .z = 2};
BinaryByter
oh okay
BinaryByter
Wow thats cool
olli
Widely used in the Linux kernel
BinaryByter
did I say that its cool?
BinaryByter
actually, thats total bullcrap
Parra
it's a gcc extension, or it used to be
Parra
linux kernel uses it
Parra
Thespartann
Parra
he talked to me too, I have blocked him