User Tools

Site Tools


cs509:cplusplusscope2

See the following code:

#include <iostream>
using namespace std;

const double MYCONSTANT = 3.1416;


void printMyConstant() {
   cout << MYCONSTANT;
}



int main () {
   const double MYCONSTANT = 3.14159;
   printMyConstant();
   return 0;
}

What is going to be output by the above program?

<poll What is going to be output by the above program? [2]>

  • 3.1416
  • 3.14159
  • Nothing since there's an error.

</poll>

cs509/cplusplusscope2.txt · Last modified: 2013/02/13 18:48 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki