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. Question about C++

Question about C++

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++performance
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.
  • L Offline
    L Offline
    Loli10
    wrote on last edited by
    #1

    Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables? Code segment #1: int score1, score2, score3; . . Code segment #2: int score[3]; . . :rose: Loli10

    C C R 3 Replies Last reply
    0
    • L Loli10

      Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables? Code segment #1: int score1, score2, score3; . . Code segment #2: int score[3]; . . :rose: Loli10

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      no difference in space. they will probably be allocated identically, too (three consecutive DWORDs) -c


      Smaller Animals Software, Inc. You're the icing - on the cake - on the table - at my wake. Modest Mouse

      1 Reply Last reply
      0
      • L Loli10

        Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables? Code segment #1: int score1, score2, score3; . . Code segment #2: int score[3]; . . :rose: Loli10

        C Offline
        C Offline
        Carlos Antollini
        wrote on last edited by
        #3

        Twice programs use the same memory size... Regards Carlos Antollini. Sonork ID 100.10529 cantollini

        1 Reply Last reply
        0
        • L Loli10

          Consider the following 2 program code segments. Which one utilizes main memory more efficiently, and which one takes up more space in main memory for variables? Code segment #1: int score1, score2, score3; . . Code segment #2: int score[3]; . . :rose: Loli10

          R Offline
          R Offline
          Roger Wright
          wrote on last edited by
          #4

          Told ya so...:laugh:

          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