What should the code print? 0 or any garbage value or will it depend on the compiler?
#include <stdio.h> int a; int main() { printf("%d\n",a); return 0; }
the answer is 0. Global variables are initialized to zero.
I would say that your code can output anything or just something can happen, because your code causes Undefined Behavior according to C99.
You do not have a prototype for printfin scope.
printf
J.2 Undefined Behavior- , , , ( 6.5.2.2).
J.2 Undefined Behavior
- , , , ( 6.5.2.2).
, a 0, .
a
0
C99, 6.7.8.10, :
, . , , , : - , ; - , ( ) ; - , () ; - , () .
6.2.4.3 :
, , . - , .
, 0. (.. -t20) ) .
[ , ] 0
0. (.. ) .
Source: https://habr.com/ru/post/1524084/More articles:WebRTC - remove / reduce the delay between devices that share their video stream? - javascriptASP NET MVC Kendo and Column Name - asp.net-mvcCSS Background size: contain image without scaling - cssWhy is the value of the automatic object stored after the end of its life? - chttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1524083/initializer-string-for-array-of-chars-is-too-long-error&usg=ALkJrhhczJgBFgK3OTQ3ViT58yDzCIAQfwWhat is the best way to add a view under UINavigationBar in iOS7 - iosJava tokenization infix string - javaGeodjango admin, displaying a point not like a map - djangoInstalling Unity from NugetStore not working - c #Есть ли ошибка в биннинге в гистограммах matplotlib? Или неслучайность метода rvs в scipy.stats - pythonAll Articles