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. Matrix dimensions

Matrix dimensions

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++beta-testingquestioncode-review
4 Posts 3 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.
  • M Offline
    M Offline
    MFC is the Best
    wrote on last edited by
    #1

    hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC

    J R 2 Replies Last reply
    0
    • M MFC is the Best

      hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      i recomand u using vector of vectors its better that way, see STL Type: std::vector If u want to use pointers its something like this:

      double ** ppDouble ;
      for ( int iLines= 0 ;iLines<iNumberOfLines;iLines ++)
      ppDouble = new (double*);

      for ( int iColumns=0;iColumns<iNumberOfColumns ;iColumns++)
      ppDouble [ iColumns ] = new double;

      for ( int iLines= 0 ; iLines< iNumberOfLines ; iLines ++)
      for ( int iColumns=0; iColumns

      Papa

      while (TRUE)
      Papa.WillLove ( Bebe ) ;

      M 1 Reply Last reply
      0
      • M MFC is the Best

        hello! in my mfc-program i need a two dimensional matrix. my problem is: the dimensions (Rows, Cols) are no constant integers, they are integers, only. a few people in this forum tried to help me, but i still have errors and problems. i know, now (because of the feedback here), that i must do something with 'new' and 'pointer'. who can help me more in detail? MFC

        R Offline
        R Offline
        Roger Allen
        wrote on last edited by
        #3

        You could use this ready built class http://www.codeproject.com/cpp/MatrixClass.asp[^] Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.

        1 Reply Last reply
        0
        • J jmkhael

          i recomand u using vector of vectors its better that way, see STL Type: std::vector If u want to use pointers its something like this:

          double ** ppDouble ;
          for ( int iLines= 0 ;iLines<iNumberOfLines;iLines ++)
          ppDouble = new (double*);

          for ( int iColumns=0;iColumns<iNumberOfColumns ;iColumns++)
          ppDouble [ iColumns ] = new double;

          for ( int iLines= 0 ; iLines< iNumberOfLines ; iLines ++)
          for ( int iColumns=0; iColumns

          Papa

          while (TRUE)
          Papa.WillLove ( Bebe ) ;

          M Offline
          M Offline
          MFC is the Best
          wrote on last edited by
          #4

          great, thanks.....:rose: only one small mistake: u wrote: for(int iColumns=0 ; iColumns

          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