I was going through some code and found this:
I'm somewhat intermediate in C programming but I've never seen if conditions preceeded by a '#' symbol. What does that mean?Code:#if __nios16__ #define SMALL 1 #endif
I was going through some code and found this:
I'm somewhat intermediate in C programming but I've never seen if conditions preceeded by a '#' symbol. What does that mean?Code:#if __nios16__ #define SMALL 1 #endif
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:expression is a C expression of integer type, subject to stringent restrictions.Code:#if expression controlled text #endif /* expression */
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.