undefined-behavior
Can ForwardIterator and OutputIterator in C++ standard algorithms be the same?
Can the \'streaming\' algorithm like std::transform or std::partial_sum read from and write to the same place?[详细]
2023-03-30 22:52 分类:问答Array pointer aliasing - undefined behavior?
Does the following code invoke undefined behavior (due to aliasing violation or otherwise)? int foo(int (*a)[10], int (*b)[5])[详细]
2023-03-28 16:05 分类:问答Weird bugs and undefined behavior of Mac App
At the moment I am experiencing a really weird behavior of my Mac App. On my Mac (and on all other testing Macs) everything works fine. The app simply works, no leaks,...[详细]
2023-03-25 03:02 分类:问答Is Type name = name; ever useful in C++?
The following code is allowed in C++: int a = a; or Type name = name; Both lead to an uninitialized object being initialized by i开发者_JAVA百科tself, which often leads to undefined behavior.[详细]
2023-03-24 01:47 分类:问答Why dereferencing a null pointer is undefined behaviour?
According to ISO C++, dereferencing a null pointer is undefined behaviour. My curiosity is, why? Why standard has decided to declare it undefined behaviour? What is the rationale behind this decision?[详细]
2023-03-22 12:32 分类:问答lambda: should capturing const reference by reference yield undefined behaviour?
I just found a nasty bug in my code because I captured a const reference to a string by reference. By the time the lambda was run the original string object was already long gone and the referenced va[详细]
2023-03-21 19:00 分类:问答What could be causing this memory access error (C++)? Might be undefined behavior?
I have a relatively large class that I\'m working with and it\'s all worked fine so far (note: I didn\'t actually write the class, I\'m just adding some functionality).However, after declaring one mor[详细]
2023-03-21 14:47 分类:问答Assigning a reference by dereferencing a NULL pointer
int&fun() { int * temp = NULL; return *temp; } In the above method, I am trying to do the dereferencing of a NULL pointer. When I call this function it does not give exception. I found when retu[详细]
2023-03-20 13:50 分类:问答What to do with $(undefined)?
I accidentally came across $(undefined) in a statement below, where params is an object: var $this = $(params._this) || $(this);[详细]
2023-03-20 00:16 分类:问答Explanation of output of C code
I came across this code: #include<stdio.h> void main() { int x; float t; scanf(\"%f\",&t); printf(\"%d\\n\",t);[详细]
2023-03-19 20:59 分类:问答