{"id":861,"date":"2020-03-07T18:42:19","date_gmt":"2020-03-07T12:42:19","guid":{"rendered":"https:\/\/open.zeba.academy\/?p=861"},"modified":"2020-03-07T18:42:19","modified_gmt":"2020-03-07T12:42:19","slug":"null-v-c","status":"publish","type":"post","link":"https:\/\/code.zeba.academy\/ru\/null-v-c\/","title":{"rendered":"\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c NULL \u0432 C"},"content":{"rendered":"<h3>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Null \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c \u043d\u0430 C<\/h3>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e null.<\/p>\n<p>\u0423 Go \u0435\u0441\u0442\u044c nil, \u0443 JavaScript null, \u0443 Python None \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>C \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 NULL.<\/p>\n<p><!--more--><\/p>\n<p>NULL \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0430\u0447\u0435 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u0412 C NULL \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c null \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043c\u044b \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u043c \u0437\u043d\u0430\u0442\u044c, \u043d\u0430 \u0447\u0442\u043e \u043e\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442. \u0412\u043e\u0442 \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e:<\/p>\n<p>int * p_some_variable = NULL;<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e NULL \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d: \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c stdio.h, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e (\u0438\u043b\u0438 stddef.h \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435):<\/p>\n<div>\n<pre>#include &lt;stdio.h&gt;<\/pre>\n<pre><\/pre>\n<pre>int main(void) {<\/pre>\n<pre>\u00a0 int * p_some_variable = NULL;<\/pre>\n<pre>}\n<\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 C \u0432\u044b\u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<div>\n<pre>hello.c:3:26: error: use of undeclared identifier<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0\u00a0 'NULL'<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 int * p_some_variable = NULL;<\/pre>\n<pre>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <span lang=\"RU\">^<\/span><\/pre>\n<pre><span lang=\"RU\">1 <\/span>error generated<span lang=\"RU\">.<\/span><\/pre>\n<\/div>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c null \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c, \u0441\u0440\u0430\u0432\u043d\u0438\u0432 \u0435\u0433\u043e \u0441 NULL:<\/p>\n<div>\n<pre>#include &lt;stdio.h&gt;<\/pre>\n<pre><\/pre>\n<pre>int main(void) {<\/pre>\n<pre>\u00a0 int * p_some_variable = NULL;<\/pre>\n<pre><\/pre>\n<pre>\u00a0 if (p_some_variable == NULL) {<\/pre>\n<pre>\u00a0\u00a0\u00a0 printf(\"equal\");<\/pre>\n<pre>\u00a0 }<\/pre>\n<pre>}\n\n\u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 NULL \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043e\u043c 0 \u0438\u043b\u0438 \"\\ 0\".<\/pre>\n<p>\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 NULL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f:<\/p>\n<div>\n<pre>char *a_string = '\\0';<\/pre>\n<\/div>\n<pre><\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e Null \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c \u043d\u0430 C \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e null. \u0423 Go \u0435\u0441\u0442\u044c nil, \u0443 JavaScript null, \u0443 Python None \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. C \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 NULL.<\/p>\n","protected":false},"author":7,"featured_media":866,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":" %%post_title%% %%sep%% %%sitetitle%%","_seopress_titles_desc":"\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e null.\n\n\u0423 Go \u0435\u0441\u0442\u044c nil, \u0443 JavaScript null, \u0443 Python None \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.\n\nC \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 NULL.","_seopress_robots_index":"","footnotes":""},"categories":[4],"tags":[15,20,25],"class_list":["post-861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-artificial-intelligence","tag-c","tag-coding"],"_links":{"self":[{"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/posts\/861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/comments?post=861"}],"version-history":[{"count":0,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/posts\/861\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/media\/866"}],"wp:attachment":[{"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/media?parent=861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/categories?post=861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.zeba.academy\/ru\/wp-json\/wp\/v2\/tags?post=861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}