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. where we used the static functions

where we used the static functions

Scheduled Pinned Locked Moved C / C++ / MFC
4 Posts 2 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.
  • R Offline
    R Offline
    Rajesh match
    wrote on last edited by
    #1

    hello bies I heard lot more about static functions that it access only static variable it count the number of objects created... and so on But still i a am unable to known in which condn it shpild be used can any one give me details with small code would apprecitaed

    D 1 Reply Last reply
    0
    • R Rajesh match

      hello bies I heard lot more about static functions that it access only static variable it count the number of objects created... and so on But still i a am unable to known in which condn it shpild be used can any one give me details with small code would apprecitaed

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

      They are used whenever you have multiple instances of an object, but only want one instance of a particular function. Callback functions are another example.

      R 1 Reply Last reply
      0
      • D David Crow

        They are used whenever you have multiple instances of an object, but only want one instance of a particular function. Callback functions are another example.

        R Offline
        R Offline
        Rajesh match
        wrote on last edited by
        #3

        Well, Dear DavidCrow u say Callback is the example of Static function callback fuctions r genrally used for repeated works in which we stored the address of the origin and get back after doing some manupulation.. How u relate all these to static functions. pls explain...

        D 1 Reply Last reply
        0
        • R Rajesh match

          Well, Dear DavidCrow u say Callback is the example of Static function callback fuctions r genrally used for repeated works in which we stored the address of the origin and get back after doing some manupulation.. How u relate all these to static functions. pls explain...

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

          class A { static int compare( const void *arg1, const void *arg2 ); void SortEm( void ); }; void A::SortEm( void ) { qsort(..., compare); }

          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