Results 1 to 14 of 14
  1. #1
    BloodSkin's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Columbus, OH
    Posts
    353
    Reputation
    11
    Thanks
    63

    simple c++ question

    what exactly is the difference between void and char? does void hold both numbers AND letters? i know char holds letters and int holds numbers, but what exactly does void hold? im not quite that far in my book, im just being curious is all. thanks in advance.

  2. #2
    ^...,^'s Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    New Zealand,Auckland
    Posts
    698
    Reputation
    4
    Thanks
    90
    My Mood
    Lonely
    .... umm i really dont mind in my hacks
    waht is this for anyway?

  3. #3
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Well I'm assuming your talking about methods when you talk about voids. A 'Void' is a method where you don't return anything. A char method would return a char value.

    Now if you want to talk about them as variables, a char like you said holds character values (like letters, symbols, or numbers). An int can only hold numerical values. A bool can only have a true or false value. A double holds numerical values with decimals (like 1.2 or something). A void is simply something that isn't there, hence the name.

  4. #4
    freedompeace's Avatar
    Join Date
    Jul 2010
    Gender
    female
    Posts
    3,033
    Reputation
    340
    Thanks
    2,792
    My Mood
    Sad
    void is nothing, void == null.

    void variables don't exist, they don't hold anything.

  5. The Following User Says Thank You to freedompeace For This Useful Post:

    mrsmexy95 (08-12-2010)

  6. #5
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by freedompeace View Post
    void is nothing, void == null.

    void variables don't exist, they don't hold anything.
    Exactly. Solved?

  7. #6
    kotentopf's Avatar
    Join Date
    Nov 2009
    Gender
    male
    Posts
    602
    Reputation
    26
    Thanks
    251
    this means a void have no return

    a char have a return

  8. #7
    LightzOut's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Posts
    185
    Reputation
    11
    Thanks
    25
    Quote Originally Posted by kotentopf View Post
    this means a void have no return

    a char have a return

  9. #8
    Kallisti's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,019
    Reputation
    52
    Thanks
    376
    My Mood
    In Love
    Quote Originally Posted by kotentopf View Post
    this means a void have no return

    a char have a return
    Thats for a function you dumbshit

    [php]void variable; //illegal
    char variable; //legal

    void function()
    {
    //doesnt return
    }

    char function()
    {
    //returns a char
    }
    [/php]

    未来が見えなくて怖いから
    未来が見えてしまって悲しいから
    目を閉じて優しい思い出に浸ってしまう




  10. The Following User Says Thank You to Kallisti For This Useful Post:

    BloodSkin (08-13-2010)

  11. #9
    speedforyou's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    735
    Reputation
    -59
    Thanks
    108
    My Mood
    Happy
    lol wow this is funny

  12. #10
    BloodSkin's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Columbus, OH
    Posts
    353
    Reputation
    11
    Thanks
    63
    ooo ok i think i understand now. so we use void when we just want to run commands but dont want any values to result from what we just did?

  13. #11
    ^...,^'s Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    New Zealand,Auckland
    Posts
    698
    Reputation
    4
    Thanks
    90
    My Mood
    Lonely
    well...thats just about it then...

  14. #12
    [F]ace!'s Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    43
    Reputation
    10
    Thanks
    2
    My Mood
    Twisted
    This will help me out a little bit
    If I learned well, char variable can only hold 1 letter, but I didn't know that "void" thingy

  15. #13
    User1's Avatar
    Join Date
    Jul 2009
    Gender
    female
    Location
    Above the influence
    Posts
    4,065
    Reputation
    61
    Thanks
    4,294,967,295
    My Mood
    Crappy
    Quote Originally Posted by [F]ace! View Post
    This will help me out a little bit
    If I learned well, char variable can only hold 1 letter, but I didn't know that "void" thingy
    char array = string basically...
    Any donations would help


    Quote Originally Posted by Bombsaway707

    HOLY SHIT ITS USER1
    Quote Originally Posted by Blood

    HOLY SHIT ITS USER1
    Quote Originally Posted by Alby-kun


    HOLY SHIT ITS USER1
    Quote Originally Posted by Ali

    HOLY SHIT ITS USER1
    Quote Originally Posted by CodeDemon
    HOLY SHIT ITS USER1
    Quote Originally Posted by Jussofresh View Post
    HOLY SHIT ITS USER1!
    [21:13] CoderNever: HOLY SHIT ITS USER1!

  16. #14
    oliveryas's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Location
    Sherborn, MA
    Posts
    21
    Reputation
    10
    Thanks
    0
    My Mood
    Inspired
    Dude your gay!

Similar Threads

  1. [Help Request] Simple Noob Question
    By csimami in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 17
    Last Post: 11-02-2011, 02:31 PM
  2. [Help]Quick Simple Fast Question[Solved]
    By Lyoto Machida in forum Visual Basic Programming
    Replies: 12
    Last Post: 02-07-2011, 12:53 PM
  3. - Simple Texture Question -
    By Silver Ace in forum WarRock Skinning
    Replies: 8
    Last Post: 10-07-2010, 10:31 AM
  4. Simple mod question..
    By caron300 in forum Combat Arms Mod Discussion
    Replies: 2
    Last Post: 09-04-2010, 11:58 AM
  5. Simple question
    By SoulRemover in forum WarRock - International Hacks
    Replies: 1
    Last Post: 04-22-2007, 09:42 AM