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. sizeof function resolution

sizeof function resolution

Scheduled Pinned Locked Moved C / C++ / MFC
6 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.
  • H Offline
    H Offline
    hawk23reddy
    wrote on last edited by
    #1

    hi if using sizeof function will this be resolved during 1. runtime 2. compile time 3. pre-compile time please give me answers

    J R 2 Replies Last reply
    0
    • H hawk23reddy

      hi if using sizeof function will this be resolved during 1. runtime 2. compile time 3. pre-compile time please give me answers

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      sizeof() is not a function, but a compile time operator. (Amazingly enough Google gives that answer as the second hit.)

      Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

      1 Reply Last reply
      0
      • H hawk23reddy

        hi if using sizeof function will this be resolved during 1. runtime 2. compile time 3. pre-compile time please give me answers

        R Offline
        R Offline
        Rick York
        wrote on last edited by
        #3

        Have you tried to figure this out for yourself ? Most compilers can write their preprocessor output and this would tell you.

        H 1 Reply Last reply
        0
        • R Rick York

          Have you tried to figure this out for yourself ? Most compilers can write their preprocessor output and this would tell you.

          H Offline
          H Offline
          hawk23reddy
          wrote on last edited by
          #4

          York, can u hint how to do it.. plz..

          J J 2 Replies Last reply
          0
          • H hawk23reddy

            York, can u hint how to do it.. plz..

            J Offline
            J Offline
            Joe Woodbury
            wrote on last edited by
            #5

            One way to see this is to have the compiler generate machine and assembly source (in output, depending on the compiler.) If you don't understand assembly, though, it may not do much good.

            Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke

            1 Reply Last reply
            0
            • H hawk23reddy

              York, can u hint how to do it.. plz..

              J Offline
              J Offline
              J B 0
              wrote on last edited by
              #6

              If you are using Microsoft compiler, Take a look its (CL.EXE) options - cl.exe /?

                                        -PREPROCESSOR-
              

              /AI<dir> add to assembly search path /FU<file> forced using assembly/module
              /C don't strip comments /D<name>{=|#}<text> define macro
              /E preprocess to stdout /EP preprocess to stdout, no #line
              /P preprocess to file /Fx merge injected code to file
              /FI<file> name forced include file /U<name> remove predefined macro
              /u remove all predefined macros /I<dir> add to include search path
              /X ignore "standard places"

              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