initilizing char to null or blank

Discussion in 'C++' started by Art Cummings, Dec 7, 2007.

  1. Art Cummings

    Art Cummings Guest

    Does anyone know how to initialize a char variable to blank or null?

    Thanks

    Art
     
    Art Cummings, Dec 7, 2007
    #1
    1. Advertising

  2. Art Cummings wrote:
    > Does anyone know how to initialize a char variable to blank or null?


    Not sure what "blank" is. A space? The null character is 0 or '\0'.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Dec 7, 2007
    #2
    1. Advertising

  3. Art Cummings

    Default User Guest

    Art Cummings wrote:

    > Does anyone know how to initialize a char variable to blank or null?


    I told you how to set one to nul yesterday. I don't know what "blank"
    means. Why do you think you need to do this?




    Brian
     
    Default User, Dec 7, 2007
    #3
  4. Art Cummings

    Art Cummings Guest

    "Default User" <> wrote in message
    news:...
    > Art Cummings wrote:
    >
    >> Does anyone know how to initialize a char variable to blank or null?

    >
    > I told you how to set one to nul yesterday. I don't know what "blank"
    > means. Why do you think you need to do this?
    >
    >
    >
    >
    > Brian


    Thanks Brian, I went back and looked at your reply. I wanted to initialize
    it to an empty string, then I realised that concept for a char variable was
    incorrect. I assigned the char the ascii zero and it basically did what I
    was trying to do.

    Thanks

    Art
     
    Art Cummings, Dec 8, 2007
    #4
  5. Art Cummings

    Art Cummings Guest

    "Victor Bazarov" <> wrote in message
    news:fjcerc$ele$...
    > Art Cummings wrote:
    >> Does anyone know how to initialize a char variable to blank or null?

    >
    > Not sure what "blank" is. A space? The null character is 0 or '\0'.
    >

    Thanks V, that's what I ended up doing.

    Art
     
    Art Cummings, Dec 8, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    27,550
    Mike Schilling
    Mar 29, 2006
  2. wwj
    Replies:
    7
    Views:
    595
  3. wwj
    Replies:
    24
    Views:
    2,573
    Mike Wahler
    Nov 7, 2003
  4. Ben Pfaff
    Replies:
    5
    Views:
    505
    Tristan Miller
    Jan 17, 2004
  5. lovecreatesbeauty
    Replies:
    1
    Views:
    1,151
    Ian Collins
    May 9, 2006
Loading...

Share This Page