Menu

Should this really work?

2012-05-20
2012-09-26
  • Glenn Stevenson

    Glenn Stevenson - 2012-05-20

    I am not sure the following code snippet should work:

    int size;
    cout << "Enter size of Magic Square (must be an odd number):" << endl << endl;
    cin >> size;
    int magic;

    Have ANSI compliant compilers always supported this? I know it doesn't work
    with Microsoft. So, which is correct DevC++ or Visual C++

     
  • Glenn Stevenson

    Glenn Stevenson - 2012-05-20

    Sorry the brackets don't show on this forum

    After magic it should be two sets of brackets to declare the array with the
    size inside them. Like the following except with brackets and not parentheses

    int magic(size)(size);

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.