Thread: Declaration Question

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    3

    Declaration Question

    I was going through some code and found this:

    Code:
    #if __nios16__
    	#define SMALL 1
    #endif
    I'm somewhat intermediate in C programming but I've never seen if conditions preceeded by a '#' symbol. What does that mean?

  2. #2
    Hello,

    The `#if' directive allows you to test the value of an arithmetic expression, rather than the mere existence of one macro. Its syntax is:
    Code:
    #if expression
        controlled text
    #endif /* expression */
    expression is a C expression of integer type, subject to stringent restrictions.

    Further info can be found here: If - The C Preprocessor


    - Stack Overflow
    Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to compile projects ?
    By manzoor in forum C++ Programming
    Replies: 31
    Last Post: 10-15-2008, 11:52 AM
  2. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  3. Quantum Random Bit Generator
    By shawnt in forum C++ Programming
    Replies: 62
    Last Post: 06-18-2008, 10:17 AM
  4. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  5. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM