Kanahaiya
And everytime I am getting this result
Kanahaiya
Kanahaiya
Why is it happening can someone explain
Kumar
Do any.. Fast
Kanahaiya
I searched it on Google and fixed some error even then the result is Sorted array is 10 times 0
Kanahaiya
So what should I do to correct it or to get desired result
Kanahaiya
Ok I am trying
Kanahaiya
It worked thanks
Kanahaiya
MᏫᎻᎯᎷᎷᎬᎠ
The standard is expected to be officially published after the end of the DIS ballot in May 2020. Is that possible with corona?
MᏫᎻᎯᎷᎷᎬᎠ
C++20
Ludovic 'Archivist'
The standard is expected to be officially published after the end of the DIS ballot in May 2020. Is that possible with corona?
It will likely be the first committee meeting to be done over the internet ever, which is somewhat pretty amazing in a way
Ludovic 'Archivist'
MᏫᎻᎯᎷᎷᎬᎠ
Hey
How is it going
MᏫᎻᎯᎷᎷᎬᎠ
Hope not
...
char *str[]={"one", "two", " three"}
...
Which address will be stored in str variable ?
...
Ohh. So the elements one two three are the pointers right
...
Thank you bro 🙏
Anonymous
Hy
Anonymous
/get dsa
Anonymous
hey why this code is not working? I just copied it from book. https://pastebin.com/kW8kd0qs
MᏫᎻᎯᎷᎷᎬᎠ
hey why this code is not working? I just copied it from book. https://pastebin.com/kW8kd0qs
create_queu didn't create anything It just assigned NULL to a COPY of queue struct
MᏫᎻᎯᎷᎷᎬᎠ
create_queu didn't create anything It just assigned NULL to a COPY of queue struct
Pass queue by a pointer to pointer And use malloc to allocate space for your struct
MᏫᎻᎯᎷᎷᎬᎠ
Tip It's better to not use a global variables here ;)
MᏫᎻᎯᎷᎷᎬᎠ
how to correct this than?
void create_queue(struct queue** q) { *queue = (queue*)malloc(sizeof(queue)); }
Anonymous
not working
MᏫᎻᎯᎷᎷᎬᎠ
not working
I helped you with a major part of puzzle Go figure out the rest
MᏫᎻᎯᎷᎷᎬᎠ
why not to return a pointer instead of void
I tried to follow some C libraries convention 🤔
MᏫᎻᎯᎷᎷᎬᎠ
Wait That convention is for making changes to the object
MᏫᎻᎯᎷᎷᎬᎠ
Yeah right Sorry
wannabe
Can anybody help me knowing better the basics or fundamentals of C
wannabe
?
Anonymous
It depends. What do you want to know?
Anonymous
:)
Hermann
are three reads on the dev / random file too many to have three random numbers?
Francisco
are three reads on the dev / random file too many to have three random numbers?
Use a pseudo-random number generator. Read one from file and generate the rest with the generator
Anonymous
/notes
wannabe
Like what are statements, what actually return function does?
wannabe
What return function do as return 0 and as return 1
Hermann
Use a pseudo-random number generator. Read one from file and generate the rest with the generator
mm...so, get seed from urandom and use rand() standard library...right?
wannabe
Can you please name them?
wannabe
Who are they?
Anonymous
C
install libbsd-dev and use arc4random_uniform
wannabe
Ok. Let me try.
wannabe
Ok, there are 4 guys, named, Kernighan, Ritchie, KN King and Jens Gustedt
Francisco
C
Then I guess your best bet is to do the srand-rand process. It's not the best way of doing it, but unless you implement a good pseudo-random number generator or use an external library, you have no choice. Reading random number from devices can be expensive compared to a generator
wannabe
Right! I'll Google them
Francisco
i can use fseek and use the same pointer
You can, but a generator is a superior solution
Dima
that suspicious name though
MᏫᎻᎯᎷᎷᎬᎠ
that suspicious name though
You should add that to the group rules Suspicious named users are banned if they didn't confirm their intentions within 5 minutes
Anonymous
#gcc9
Anonymous
😂
Anonymous
#cbook
Anonymous
#goodgoogling
András
Bullshit VS can't even in normal autocomplete
Sahil
Int c = 3; Int b = ++c + c++;
Sahil
Can any one explain the value of b
Pavel
It's specified after C++17 I guess
Sahil
What if Int b = ++c + c++ + --c
Sahil
But output is 9
Pavel
Hmm, ok then
Sahil
Value of b is 9
Sahil
Ok
Sahil
Thank you
Hubert
that's not UB
Hubert
because the variable has been declare with explicit initial value
Pavel
because the variable has been declare with explicit initial value
https://en.cppreference.com/w/cpp/language/eval_order
Pavel
There are examples of UB at the bottom of the page
Pavel
That's sad that they didn't fix this case
Pavel
Well, not that I want to use it