#if !CLOCK

This is a discussion on #if !CLOCK within the C Programming forums, part of the General Programming Boards category; Greetings. I'm a novice. what does the # sign in front of an if statement mean? I've got this: #if ...

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    #if !CLOCK

    Greetings. I'm a novice. what does the # sign in front of an if statement mean?

    I've got this:

    #if !CLOCK
    blah
    blah
    #else
    blah
    #endif

    Also, why aren't brackets and parenthesis needed?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    23,624
    You are looking at preprocessing directives, so the rules are a little different.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    2
    thank you. I've been trying to track down the variable CLOCK because i thought if i found it it would lead me to the answer. But it is an elusive little variable

  4. #4
    Registered User slingerland3g's Avatar
    Join Date
    Jan 2008
    Location
    Seattle
    Posts
    603
    Check all your included header files as well.

  5. #5
    {Jaxom,Imriel,Liam}'s Dad Kennedy's Avatar
    Join Date
    Aug 2006
    Location
    Alabama
    Posts
    1,065
    And any Makefiles you have. Preprocessor commands don't have to have #defines, but can also have command line defines.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logical Error in Clock program
    By SVXX in forum C++ Programming
    Replies: 0
    Last Post: 05-10-2009, 12:12 AM
  2. Outside influences on clock cycles? (clock_t)
    By rsgysel in forum C Programming
    Replies: 4
    Last Post: 01-08-2009, 05:15 PM
  3. Clock Troubles
    By _Nate_ in forum C Programming
    Replies: 22
    Last Post: 06-19-2008, 05:15 AM
  4. clock program
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 03-30-2007, 10:12 PM
  5. using clock()
    By sl4nted in forum C Programming
    Replies: 8
    Last Post: 11-09-2006, 06:16 PM

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