Newbie C programming questions

This is a discussion on Newbie C programming questions within the C Programming forums, part of the General Programming Boards category; I know programming in java , but I need some help in c department. I am working on a code, ...

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    33

    Newbie C programming questions

    I know programming in java , but I need some help in c department.
    I am working on a code, the code exists so i need to read it udnerstand it and improve it.

    so i need some answers on small things

    for ex.
    char temp[17];
    temp[0] = 0x00;

    What does this stand for? the bolded one.Thank you

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,144
    Hint: 0x is the prefix to designate a hexadecimal integer literal.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    33
    Okey,so it's just the hex encoding of 0.


    So why not temp[0] = 0 ?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,144
    Maybe the author is dealing with bits in that part of the code and used hex notation for the other constants, and thus decided that writing 0x00 would be stylistically consistent. Or maybe the author wanted to confuse people who don't know about the notation
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    33
    okey thanks, I will come up with more questions I see in the coding.

    I just bump the thread later

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 11-09-2011, 03:48 PM
  2. Newbie questions
    By Black_Epiphany in forum C Programming
    Replies: 5
    Last Post: 09-23-2011, 08:39 PM
  3. Im a newbie to C and i have some questions
    By pave1104 in forum C Programming
    Replies: 5
    Last Post: 07-05-2006, 10:48 PM
  4. Newbie IO questions
    By gustavosserra in forum C Programming
    Replies: 5
    Last Post: 08-29-2003, 09:09 AM
  5. c++ newbie questions
    By dune911 in forum C++ Programming
    Replies: 2
    Last Post: 09-14-2001, 07:30 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21