Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. loop problem

loop problem

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gentleguy
    wrote on last edited by
    #1

    dear all for (int iiY=0;iiY { for (int iiX=0;iiY { for (int kk=0;kk<3;kk++) { ucImgdata[iiY]=ucImagdata[iiY-1]*mask[kk]; } } } my problem is how to get the following loop: ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];

    Li Zhiyuan

    N M D 3 Replies Last reply
    0
    • G gentleguy

      dear all for (int iiY=0;iiY { for (int iiX=0;iiY { for (int kk=0;kk<3;kk++) { ucImgdata[iiY]=ucImagdata[iiY-1]*mask[kk]; } } } my problem is how to get the following loop: ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];

      Li Zhiyuan

      N Offline
      N Offline
      nbugalia
      wrote on last edited by
      #2

      First - Your for loops are incomplete. You can achive the same using the following loop - int testval = 0; for (int i = -1, int j = 0; i < 3; i++, j++) { testval += ucImagedata[iiY + i]*mask[j]; }

      1 Reply Last reply
      0
      • G gentleguy

        dear all for (int iiY=0;iiY { for (int iiX=0;iiY { for (int kk=0;kk<3;kk++) { ucImgdata[iiY]=ucImagdata[iiY-1]*mask[kk]; } } } my problem is how to get the following loop: ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];

        Li Zhiyuan

        M Offline
        M Offline
        Michael Schubert
        wrote on last edited by
        #3

        Did you follow the advice of other users here and buy a book? Having read through some of your posts it would appear that you are lacking some basic C/C++ knowledge. You're basically banging your head against a wall hoping to punch through if you do it long enough. It's not going to happen until you get yourself the right tools.

        1 Reply Last reply
        0
        • G gentleguy

          dear all for (int iiY=0;iiY { for (int iiX=0;iiY { for (int kk=0;kk<3;kk++) { ucImgdata[iiY]=ucImagdata[iiY-1]*mask[kk]; } } } my problem is how to get the following loop: ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];

          Li Zhiyuan

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          li zhiyuan wrote:

          for (int iiY=0;iiY { for (int iiX=0;iiY

          Did you bother to preview these before posting to make sure they looked right?

          li zhiyuan wrote:

          my problem is how to get the following loop: ucImgdata = ucImgdata[iiY-1]*mask[0]+ucImgdata[iiY]*mask[1]+ucImgdata[iiY+1]*mask[2];

          That is not a loop.

          "Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups