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. Managed C++/CLI
  4. about void

about void

Scheduled Pinned Locked Moved Managed C++/CLI
5 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
    Hamsika rani
    wrote on last edited by
    #1

    tell me about void in c language

    S J 2 Replies Last reply
    0
    • H Hamsika rani

      tell me about void in c language

      S Offline
      S Offline
      sarah_malik
      wrote on last edited by
      #2

      you should be more specific. Generally, void is used in functions. 1)If the function does not return any value,ex: void Print_Numbers (int i) { for (i;i<100;i++) cout< When you call the above function, you should send an integer parameter,say n, and the function will print the values from n to 1000. No return type is needed, that is, void will be set as a return value. 2)You can have the parameter also to be void instead of (i). In this case you should initialize the variable i inside the function. I hope this is what are you looking for,

      H 1 Reply Last reply
      0
      • S sarah_malik

        you should be more specific. Generally, void is used in functions. 1)If the function does not return any value,ex: void Print_Numbers (int i) { for (i;i<100;i++) cout< When you call the above function, you should send an integer parameter,say n, and the function will print the values from n to 1000. No return type is needed, that is, void will be set as a return value. 2)You can have the parameter also to be void instead of (i). In this case you should initialize the variable i inside the function. I hope this is what are you looking for,

        H Offline
        H Offline
        Hamsika rani
        wrote on last edited by
        #3

        thanks for ur response.... but i need significance of "void"

        M 1 Reply Last reply
        0
        • H Hamsika rani

          thanks for ur response.... but i need significance of "void"

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          :~ void (C++)[^] Fundamental Types[^]

          "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

          1 Reply Last reply
          0
          • H Hamsika rani

            tell me about void in c language

            J Offline
            J Offline
            John R Shaw
            wrote on last edited by
            #5

            Void: The total absents of anything. 1) If void it the return type, then the function returns nothing. 2) If void is an argument to a function, then the function takes no arguments. 3) If you convert a pointer to a variable to a pointer to void, it means that only you (normally) know what type it origanaly was. Very handy for passing around indirect references (pointers) to types, but dangrous if the reciever converts it to a variable type other than the original type. By the way most modern operating systems depend on this ability, because message passing requires the ability to pass references (actually indirect references) around. It is that simple.

            INTP "Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra

            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