Why does the syntax allow function declarations inside function bodies?
This raises a lot of questions about SO, where function declarations are mistaken for initialization variables, etc.
a object();
Not to mention the most unpleasant analysis.
Is there any precedent that is not easy to achieve with more general scope hiding features, such as namespaces and member spaces?
Is this for historical reasons?
Appendix: if for historical reasons inherited from C to limit the area, what is the problem that prohibits them?
++ ++-, , C ++-. ++ ( "" API, - OpenGL cURL , C, , C )
, " - ", ++ . , , , , , - , , , NONE ++ - , ( - ).
, ++ - , , . static , , auto - , C, "" , , ( , 20 ).
static
auto
, C, , , , . , , , , .
- , , - , ++. ++ C. , , . , , ( gets(), ).
gets()
, . , -, , , .
, . , , , . , , , , . .
, , .. .. C ++ ( ) , "" " ". , , . , (, , , , ).
Source: https://habr.com/ru/post/1599396/More articles:Replacing some characters in a string with characters stored in an array inserts garbage - cHow to get Google to automatically register a user in PassportJS? - javascriptThe density of the plot with ggplot2 without a line along the x - r axisWhy can't I specialize in std :: tuple_element? - c ++ 11How can I implement a dropdown list inside a uialertcontroller using swift - iosSlack slash commands - show user input? - node.jsExclude section field from selected queries in Hive - hadoopSoundTransform panning does not work with rtmp stream with ActionScript 3.0 - actionscript-3Overriding the default layer type in a UIView in swift - iosEntity Framework 6 - extension methods for DbFunctions - c #All Articles