I saw a code today, there is such a sentence:
pListHead *pListHead,*pToBeDeleted;
if(!pListHead||!pToBeDeleted)
I have never understood, this! The mode of the + pointer indicates that the pointer is not initialized, or the pointer is empty.
I did two experiments, the code is as follows.
int *p;
if(!p){
cout<<"true";
}
This is a pointer without initialization, and the result is directly displayed.
int *p=new int;
if(!p){
cout<<"true";
}
Can run, no executionifcontent.
This indicates that the pointer P as long as initialization allocation memory space,! P is false.
int *p=nullptr;
if(!p){
cout<<"true";
}
print:true
This shows that for non-symbols "!", Only pointers are TRUE.
Then I did experiment with the variable INT.
int i
if(!i){
cout<<"true";
}
Compile Error
This is not good, as long as it is not initialized, it is not possible to perform non-judgment.
int i=5;
if(i){
cout<<"true";
}
print:true
Only in this way can be compiled, so for non-pointer variables, as long as it initializes the TRUE in IF.
An exception occurred when adding a mouse listener events awt Swing project Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at day02.LoginFrame$MyAct...
java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" at org.springframework.security.crypto.password.DelegatingPasswordEncoder$Unmapp...
Error may: 1. Create a new file in your templatetags app directory folder is defined as the package did not create __init__.py 2. issue written procedures Create a file in templatetags myfilter.py htm...
The pit of my relatively long time, in order to prevent other people into the pit, on the timely write a blog to tell the others, in line withKnowledge and technology sharing principle. Because these ...
Exception in thread "main" java.lang.ExceptionInInitializerError. Today, the above error prompt abnormal main thread "Properties" when writing programs with DBHelper As shown below...
1. The following error appears in the maven-jstorm project: 2. The reason is: the jar package required by jstrom is not installed Solution: downloadjstormSource package download link: https://github.c...
demand Get content from the database and convert it to JSON format tool The Postman tool is used here as a verification of the PHP file interface (API) Code snippet 1(Without using header) First look ...
ScrollView is one of Android’s most commonly used widget and is also one of the easiest to use. When something is too big to fit on screen, drop it inside a ScrollView and you&rsq...
Question: Nginx's content replacement function,Integrate third-party replacement modules: ngx_http_substitutions_filter_module reports an error: Solution: Confirm that the configuration parameters con...
Restart Nginx, if... In centos, the following error occurred when configuring nginx's https. nginx: [emerg] unknown directive "ssl" in /usr/local/nginx/conf/nginx.conf:102 Go to the unzipped...