\Device\NUL
?
Hima
Given a string, how many different substrings exist
in it that have no repeating characters? Two
substrings are considered different if they have a
different start or end index.
Example
S = "abac"
The substrings that have no repeating characters in
them are "a", "b", "a", "c", "ab", "ba", "ac", and "bac".
Note that "aba" and "abac" do not qualify because
the character 'a'is repeated in them. Also note that
two substrings, "a" and "a", both qualify because
their start indices are different: s[0] and s[2]. There
are 8 substrings that have no repeating characters.
crintion
ho ritor
Take two pointers and a seen array for the char is seen somewhere before or not.
Hades
ببب ب
In C++20, does copy elision happen on co_yield? At the moment I'm returning an rvalue reference, but I understand this is unnecessary on ordinary functions, and bad practice since it miscommunicates intent.
Ah Fan
hello guys, i need some helps to finish ny works. rn im working on an ordering system, the system will give me a 6 percent discount if i enter 'AE6GY' Code. i already create a switch statement but i didnt get a right answer. can any of you guys can spot the error. thanks
Anonymous
Post data to ssl website using winapi cpp
Is it possible
Hitesh
Hey, any one has used Xtensor library?
Alaa
Hello guys
Alaa
Can you recommend me some good books or studying recourses to learn C++?
Alaa
I’m a student in the international informatics Olympiads and I need something good to be able to compete
I’d be happy if you can help
AmR
Who know and class for personal name cases ?
artemetra 🇺🇦
Alaa
Ludovic 'Archivist'
Arnold
it's sometimes hard to understand what they're saying but the content itself is amazing
D
Anyone know gdbm
?
Nicky
Please help me to know, i am unable to c programme from base level, can anyone suggest me anything?
Rajesh
How to return strings from c++ to java
?
Anonymous
Anonymous
?
?
Anonymous
#question
Hello everyone,
I wrote an example for testing mongocxx library
I wanna debug my example code and examine some variable of mongocxx and bsoncxx libraries when debugging.
but it says:
Function boost::optional<mongocxx::v_noabi::result::insert_one>::get has no address, possibly due to compiler optimizations.
how can I see value of that in runtime using watch or any other way possible??
Arnold
I don't like C++20, C++ is becoming unnecessarily complicated. They're trying to turn my beloved C++ into compiled Python with all that high level nonsense. No reason to go beyond std::vector.
Golden Age Of
Anonymous 🇪🇦
Arnold
https://en.cppreference.com/w/cpp/language/modules Wikipedia has a decent enough overview Net Miau El Follagatas de la red
Man, modules were a terrible idea. Why further bloat the language with something so unnecessary?
Anonymous 🇪🇦
Ehsan
Pavel
Should I use any memory order other than relaxed if I don't care about order of operations happening with the atomic, just care that each operation is atomic by itself (e.g. a counter that I want to increment, but not doing any synchronization on this counter value)?
Pavel
And also what memory order should I use if I want to set the value if the new value is bigger? Like this:
std::atomic<int> mMax = 0;
void setIfBigger(int newValue)
{
int previous = mMax.load();
while (previous < newValue && !mMax.compare_exchange_weak(previous, newValue)) {}
}
As I see, I need to provide the memory order for the first load, for the exchange success and failure. My guess that everything should be "relaxed" in my case 🤔. And if I wanted to sync on this variable (setting something before setting the value), then only the success order should be "release", and all others "relaxed"?
Aditya
hello guys....
Aditya
int arrSize = *(&arr + 1) - arr;
Aditya
i am not getting that line of code
Aditya
can anyone explain me...
klimi
and what is arr?
Aditya
that is array of numbers
Aditya
i was looking for the methods of finding length of array....then i found that, but i am not getting that....
Coffee
/get cbook
Unknown
Hello everyone what this means in C because I read a lot and never get the idea
**
*
Also this one what should do
(int **)malloc(sizeof(int *)*SIZE);
(int *)malloc(sizeof(int)*SIZE);
klimi
it's about allocating memory and then casting it to some pointer (even though casting is usually implicit)
Unknown
Pavel
int arrSize = *(&arr + 1) - arr;
This code is really confusing.
As I see testing it, when we do &arr we adress the same memory with type of the array (wat?), then we do +1 to shift the point on sizeof(arr), and then doing dereference we transform this address back to array type (wat2?) and subtract the start of the array (get difference between addresses divided by sizeof of array element).
WTF
Pavel
What kind of help you need?
Have you read the rules, by the way?
klimi
so as input you have 2 coordinates and you need to return bool based on what?
Pavel
on an empty board?
Pavel
then the answer is always true, there's no place on a chess board from which queen can't move
klimi
Pavel
klimi
well then it's just bunch of if... (based on how big the board is etc)
Anonymous
int arrSize = *(&arr + 1) - arr;
This is Undefined Behavior because you are dereferencing an invalid pointer. So you shouldn't be using code like this.
As far as explanation for the code goes, &arr is a pointer to an array. Let us assume arr is an int array of size 3. So &arr will be int (*)[3]. Now &arr+1 will point to an array of 3 integers that is 3*sizeof(int) bytes away from &arr.
The invalid operation *(&arr+1) decays to a pointer to the first element of this array i.e. an int* pointer. You subtract arr (which is also an int* pointer) from it. You get 3
klimi
no, i politely decline
Rajesh
How to return std::string from c++ native method
Rajesh
Please anyone tell me
Rajesh
Want to return string from c++ to java
Anonymous
Anonymous
Pavel
Anonymous
Pavel
With respect to
ah, I thought it's some technical term/abbreviation :D
Anonymous
guys how can i check is there something in string, in C
coal
c with classes
coal
/s
coal
what do you mean with "one statement"
Prince Of Persia
Not completely but I would be happy if I be able to help you