Anonymous
k
Anonymous
I'll debug it and watch all the variables till it crashes.. I'll update you @TheLonelyAdventurer
Nomid Íkorni-Sciurus
does it close or something like that
Anyway if you have a while(true) kind of loop, you could expect NOMEM related errors if you didn't clean something
Anonymous
yea I do
Dima
Bruh
Anonymous
Is there any c# group i can join?
manas
Yes you can. It's called operator precedence
Anonymous
hey Longest Substring Without Repeating Characters in c can anyone please guide me
manas
First one
manas
Google operator precedence
manas
What?
manas
What are you trying to achieve
manas
Then this will work
Junipier
Guys can anyone help me with this
Yuval
I'm looking for a good project to jump back to cpp. Any suggestions?
Anonymous
I have a question for programmers can i copy the .cpp code and put it in .h ?
Anonymous
I do not want to use more than three .cpp
Anonymous
Anonymous
can I do this ?
Dima
yes but is a bad practice for large projects
Dima
if yours is small enough then its okay
Dima
but entry point must be in cxx file, as I know
Anonymous
Thanks dima
Francisco
I have a question for programmers can i copy the .cpp code and put it in .h ?
You can, but if you can separate them, it's better as you avoid recompilations
Francisco
Sometimes you can't separate them, as it happens with template and constexpr code
Asad
Quick Question: Which one of these is easier to understand and use: SFML or Qt GUI libraries?
Anonymous
Anonymous
is above ans is correct for this ques?
Asdew
No, it shouldn't be. Check the warnings you get when compiling.
Marián
quick question... i do auto it = map.begin(); it--; NEED TO CHECK HERE IF ITERATOR IS STILL VALID
Marián
can i do this somehow? i have hashmap of lower-upper bounds and I only store upper bound, getting lowerbound as previous items upper bound so i can do it—;
Francisco
quick question... i do auto it = map.begin(); it--; NEED TO CHECK HERE IF ITERATOR IS STILL VALID
Do you know that decrementing the begin iterator is probably undefined behaviour?
Marián
hmm it works doe
Marián
any other way i could approach this?
Francisco
But what do you want to achieve by decrementing a begin iterator?
Marián
i don't want to decrement begin iterator -> i am doing this, look
Artöm
Weird
I did what he asked for
Marián
let's say i have a table filled up with data char <> upper_bound i want to retreive upper bound of char? simple map.find(given_char)... i want to retreive lower bound? I know, that lowerbound is upper bound of previous item and since its unordered map i can do... auto it = map.find(given_char) it—; it->second; MY SEARCHED LOWER BOUND
Marián
but what if I am going for first element that has upperbound of lets say 0.2 and lower bound of 0 of course... in this situation, it'll do first_element_iterator— and that's not valid
Marián
and i wan't to check for this situation somehow to simply return 0
Artöm
The heck
Artöm
Whats type of map?
Marián
just (ordered) std::map
Artöm
No, it has a type
Marián
lets say <char, float>
Artöm
Ok, so how do you store lower bound of first char?
Francisco
just (ordered) std::map
There're like 4 different map containers in the STL, so just a map is not enough info
Marián
https://en.cppreference.com/w/cpp/container/map just this one, and it doesn't even matter if it's map / dictionary call it whatever you want and it's ordered
Marián
Ok, so how do you store lower bound of first char?
i do not, i am getting it from previous entry, that's what this si all about
Artöm
Like \0
Marián
but isn't there something "nicer"?
Marián
what if'll need to use map.size() somehow and this will mess it up
Artöm
Without comparing with map.begin()? No
Marián
of course ~ i can do -1 but still
Marián
well but how would you compare it to map.begin()
Artöm
Just write a function to get lower bound
Marián
like it—; if(it < map.begin()) return 0;
Artöm
Marián
hmm okay, makes sense
Marián
yup i guess i can do that thanks
Marián
also i may store lower bound and do it++ while checking for map.end()
Marián
since i know that the top bound will always be 1
Marián
thanks tho
Asdew
In C89, at the beginning, otherwise you're free to do it anywhere you want.
Asdew
I'm not sure about style, though.
Dima
it says a pointer that it is the same when you’ll try to use it, not modified so it won’t be load’d again
Dima
if I remember it properly..
Dima
microoptimizations
Anonymous
restrict pointers to a range of memory will mever overlap
Dima
but I am kinda correct too
Anonymous
but I am kinda correct too
no, restrict is about overlap. memcpy(void *restrict, void *restrict, size_t); memmove(void *, void *, size_t);
Anonymous
no, restrict is about overlap. memcpy(void *restrict, void *restrict, size_t); memmove(void *, void *, size_t);
use memcpy when you are sure that areas doesn't overlap; otherwise use memmove
“👨🏻‍💻” Ahmed;
Hello everyone i have a question , should i start learnning C language or go directly to C++ ???