DGPickett 20

== is a shallow comparison, like shallow copy, true only if the refrences are identical, not the objects. http://adripofjavascript.com/blog/drips/object-equality-in-javascript.html JAVA and C++ also have this sort of limitation unless you overload the == operator or use a method, like compareTo, equals, and JAVAScript isEqual. JAVA Sets use object.equals(), which is furstrating as you cannot override with your own class.equals().

JamesCherrill commented: About as wrong as a post can be -3

DGPickett 20

The hollow diamond is about distance from center column and distance from center row; their sum s/b half the height to print. In this case, 3. So:

for ( int c = 0 ; c < 7 ; c++ ){
  for ( int r = 0 ; r < 7 ; r ++ ){
     If ( r + c == 3  || r - c == -3 || r + c ==  9 || r - c == 3 ){
        cout << ā€˜*ā€™ ;
      }
    }

     cout << ā€˜\nā€™ ;
   }
// r + c goes from upper right to lower left
// r - c  goes from upper left to lower right
Reverend Jim commented: On Daniweb we strive to help. Doing someone's homework for them is not helping. -3