null-pointer
NULL passed directly to a function expecting a const reference parameter (VC++ 4.2)
I am looking at something that I discovered in an old code base, and I am pretty confused. Here is a function definition:[详细]
2023-04-03 13:24 分类:问答Pointer conversion issue with Ternary operator
I know the ternary operator has some surprising restrictions, but I was a bit baffled that this fails to compile for me:[详细]
2023-03-22 15:07 分类:问答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 分类:问答Is it undefined behaviour to delete a null void* pointer?
I know that deleteing a null pointer is a no-op: In either alternative, if the value of the operand of delete is the null pointer the operation has no effect.[详细]
2023-03-09 17:01 分类:问答c++ functional programming ( boost::phoenix && boost::spirit) testing for null-ptrs in pointer placeholders
So, I have the following spirit karma rule body: base_rule = eps(_r1 != 0) [ // _r1 is a pointer_typed placeholder[详细]
2023-03-09 16:16 分类:问答How do we check if a pointer is NULL pointer?
I always think simply if(p != NULL){..} will do the job. But after reading this Stack Overflow question, it seems not.[详细]
2023-03-09 04:52 分类:问答C++ Linkedlist simple question
I\'m trying to check if an entity exists in a given linkedlist.This is my code: bool LinkedList::existByID(int ID)[详细]
2023-03-07 17:34 分类:问答C++ Losing pointer reference after scope end
I\'m getting a really weird error where after I leave the for scope I can\'t access whatever my pointer was pointing during the loop even if the array holding the objects is declared in the class head[详细]
2023-03-04 16:21 分类:问答Uninitialized pointers in code
I am learning C++ and I came to know that pointers if le开发者_开发百科ft uninitialized could point to random locations in memory and create problems that memory might be used by some other program.[详细]
2023-03-03 01:24 分类:问答Is it guaranteed to be safe to perform memcpy(0,0,0)?
I am not so well-versed in the C standard, so please bear with me. I would like to know if it is guaranteed, by the standard, that memcpy(0,0,0) is safe.[详细]
2023-02-15 21:37 分类:问答