CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    27

    problem with ofstream?

    The code I have a problem with has been shortened so that only the relevant part is in this message. I have a problem with this code in that the value for height[a][b] vanishes from 0 to 1, from certain values of a and b, as a and b increase in the loop just under the message 'check heigh BEFORE 1st sweep'. So for example, if I have height[10][11]=1, height[15][19]=1, and height[35][12]=1, first height[10][11]=0, then height[15][19]=0 and lastly height[35][12]=0. This makes no sense as none of the conditions of

    (height[a][b]=height[a+1][b]) || (height[a][b]=height[a-1][b]) || (height[a][b]=height[a][b+1]) || (height[a][b]=height[a][b-1])

    are satisfied, otherwise I would get one of the messages, such as 'WORKS NOW'. Thus, the value of the heights shouldnt change at all, let alone decrease one at a time.
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: problem with ofstream?

    an equality test in C is done by ==
    a single = means an asignment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured