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. How do I create a CArray of complex numbers in VC++

How do I create a CArray of complex numbers in VC++

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++businesstutorial
5 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
    Michael Liu
    wrote on last edited by
    #1

    Anyone knows how to create a CArray of complex numbers? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

    J 1 Reply Last reply
    0
    • M Michael Liu

      Anyone knows how to create a CArray of complex numbers? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      CArray<std::complex<double>,std::complex<double>&> array;

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      M 2 Replies Last reply
      0
      • J Joaquin M Lopez Munoz

        CArray<std::complex<double>,std::complex<double>&> array;

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

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

        Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

        1 Reply Last reply
        0
        • J Joaquin M Lopez Munoz

          CArray<std::complex<double>,std::complex<double>&> array;

          Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

          M Offline
          M Offline
          Michael Liu
          wrote on last edited by
          #4

          In complex number class, can I be able to just change the value Real or Imaginary? mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

          M 1 Reply Last reply
          0
          • M Michael Liu

            In complex number class, can I be able to just change the value Real or Imaginary? mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)

            M Offline
            M Offline
            markkuk
            wrote on last edited by
            #5

            No, you can't directly change the parts. You must use an assignment, e.g.

            std::complex<double> c(1.0, 2.0);
            ...
            c = std::complex<double>(c.real(), 3.7);

            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