• Question #8: Given the code below, the variable y can be accessed in which blocks of code?


    Question #8: Given the code below, the variable y can be accessed in which blocks of code?
    55% on 11229 times asked

    1  int main(int argc, char** argv)
                2  {
                3
                4   if ( argc > 10) )
                5   {
                6
                7   }
                8   else if (int y = argc - 1 )
                9   {
                10
                11  }
                12  else
                13  {
                14
                15  }
                16
                17  return 0;
                18  }
    lines 4-15
    lines 4-17
    lines 8-11
    lines 8-15 - correct
    lines 8-17

    description: The variable declared in the else-if did not exist before its declaration and can not be used after the end of the else clause. Variables declared in conditions of if,else-if,else structures can be used in all subsequent conditions and bodies of the if,else-if,else structure.

  • 相关阅读:
    自动机
    C语言文法
    实验报告一:词法分析
    Python的基础综合练习
    Python基础综合练习
    turtle画五星红旗
    熟悉常用的Linux操作
    大数据概述
    对学习编译原理的看法
    LINUX
  • 原文地址:https://www.cnblogs.com/rickiedu/p/1454267.html
Copyright © 2020-2023  润新知