☬ੴ Bassi
noted from a few groups people join post a video or click bate and then just simply leave.
Dima
Dima
☬ੴ Bassi
ok i will try hat now i have another telegram account
☬ੴ Bassi
my other account only just joined
Dima
what the heck is going on
Anonymous
Please dont ban my other account it was just to test
Dima
yeah
Anonymous
I have a question about pointer syntax.
The programm Works withpointer *ptr and pointer* ptr also.
pointer *ptr
I see this like "the value of ptr points to is of "pointer" type.
pointer* ptr
I see this like "there os a pointer ptr of type pointer"
But, the First one is correct more than Second one because a pointer is just a int value of a memory address.
Is this correct? If not, why not? Appreciate some reference If possible
Anonymous
@Kotheos posso diventare supporter antistormbot
Vlad
Ajay
Anonymous
/thread
Dima
Anonymous
/coroutine
Dima
bruh
Dima
/blue_text_must_click
Miret
Hey
Anonymous
Any buddy can explain the logic of rock paper scissor game
Anonymous
Code
V01D
Code
You forgot to share the code
Anunay
Any buddy can explain the logic of rock paper scissor game
This group isn't meant to spoon-feed you. We are here to help you out, but you do need to put in efforts from your side. Show us the code, we can help you improve it or identify points of failure but simply asking for algorithm or code isn't something which would be tolerated here.
Anunay
It's essential that the quality of this chat remains good.
M
Hello guys, just a quick syntax check needed.
Will the following line of code execute the function, given the value is TRUE
if (!vote(name))
{
printf("Invalid vote.\n");
}
Kenny
Your function return true?
Pavel
Kenny
! function () same as function() == false
M
Weird. It is an excercise - I am given a code and I should only work on the implementation of functions. However, the given code makes no sense if the function won't be executed for value of 1
Kenny
So it'll execute if function return false
Pavel
klimi
M
Kenny
What part bro?
M
If I were the one coding, I would've called the vote function after checking the name for validity
M
anyway, I'll just go through the code again to figure out what it's doing
klimi
Um just look at the https://cs50.harvard.edu/x/2020/psets/3/plurality/ where they describe how it should be implemented
Kenny
Oh the vote function must loop on your candidates array and look if the vote == any candidate name, if both are equals then increment the votes counter
M
M
Kenny
Yes, you should implement that i said on the vote function man
M
I understand that but the point is - I don't see where the function's called.
It won't execute if the name is wrong, right.
But if it's correct, it still won't.
Kenny
Sure, you must see in the function if the name is invalid, If it is then don't increment the vote counter
M
yes, this is super clear.
but where in the main function do we call the vote function? that's my question..
Kenny
When you are looping on all voters
Wojak
/ban all 3 messages posted by user were cringe
Hey, what if he didn't know good English or lacked communication skills or was just an introvert who didn't know how to communicate?
And was trying hard against all this looking out like an imposter who personified himself as cringe? 🤔🤔
Wojak
Jk
Wojak
Having DEQUE in STL, can we replace it as a permanent substitute to stack due to push_front or push_back?
Anonymous
Anonymous
it creates a stack interface by using the interface of another container (default is std::deque, but you can pass it any container that supports back(), push_back(), and pop_back() like std::vector or std::list)
Wojak
That's what I'm asking if it is a bad practise to use Double-ended queue as stack or queue because we are initializing just one container and it can be used multiple times for multiple operations
Wojak
otherwise we would need different containers to act as a stack or queue
Anonymous
Wojak
Okkk...
Anyone else who would like to show some light upon this ?
Dima
maybe you need a circular buffer?
Wojak
maybe you need a circular buffer?
Never heard about this, got a basic idea by googling it.
Can you hint a little about circular buffer's use in this scenario?
Dima
audio buffer
Dima
well its kinda complex, but I’ve used it for audio streaming
Wojak
And how can that be used here ?
Wojak
in context to stack,queue and deque
Dima
you put something in the beginning, while the other thread is reading it from the end, but its circular, so it doesnt get oveflowed
Dima
the key difference I think is that it can’t overflow
Dima
it simply moves end pointer to the start
Wojak
Wojak
Great. Thanks
V01D
int **ptr;
= ptr is a pointer to a pointer to an int - Why would I use this?
V01D
Remove using statement, heard it's bad practice.
Kenny
Anonymous
Global usings are bad practice, yes
Kenny
Anonymous
This is not a good code since you're using unstable boost API (boost::beast::core::detail)
Anonymous
why?
Because there's at least std::vector
Kenny
What exactly does that mean?
i used it as a 2d array.
Normal: int matrix[N][N];
I did int **matrix;
Because i was reading a file, and it gave me the N parameter
V01D
V01D
Yeah, but I don't get why it exsists.
Anonymous
/get cppbookguide