What's the difference between:
const variable = 10;
and
const int variable = 10;
Is a variable, standard, interpreted as an integral type if the type is not defined?
const variable = 10invalid C ++, but const int variable = 10;-.
const variable = 10
The only time I can think of what const variable = 10would be right is if you had a type with a name variableand you had a function with an unnamed parameter of that type that takes a default argument:
variable
typedef int variable; void foo(const variable = 10);
, x int. ++, C C , ISO ++, ++ - .
GCC 4.4 groks "const x = 3;" feed -fms-extensions ( , , MFC)
UPDATE: VS-2005, int,
#pragma warning(disable:4430)
++.
Without strict rules (K & RC, etc. Editing: i.e. old C), int is the default type. This, of course, does not mean that the variable has no type, and it has nothing to do with a constant.
Source: https://habr.com/ru/post/1754484/More articles:What Javascript (Not.htc) solution can really make a corner rounded corner in IE7 and 8? - cssMPMusicPlayerController stops sending notifications - objective-cHorizontal subnav CSS questions! - cssGWT BOOTSTRAP - Question - javascriptКак я могу предотвратить отображение окон в .NET? - c#Jar mySQL name and location - javaVS2010 Locking keypad (or at least parts of it) - lockingGetting python exceptions printed in the usual way with PyObjC - pythonEfficiently back up many versions of git repository with branch extension - gitCreate product review in Magento - magentoAll Articles