Below are some more interesting facts about C programming:
1. Macros can have unbalanced braces:
2. Use main to declare one or more integer variables:
3. “%m” when used within printf() prints “Success”
m (conversion specifier) is not C but is a GNU extension to printf. The ‘%m’ conversion prints the string corresponding to the error code in errno.
%m only prints “Success” when “errno == 0” (it’s short for a string representation of the last observed error state). For example, if a function fails before the printf, then it will print something rather different.
4. brk(0); can be used as an alternative for return 0;
brk() and sbrk() change the location of the program break, which defines the end of the process’s data segment.
Logically it seems impossible to write a C program without using a main() function. Since every program must have a main() function because:-
- It’s an entry point of every C/C++ program.
- All Predefined and User-defined Functions are called directly or indirectly through the main.
But in reality, it is possible to run a C program without a main function.
Compilation using the command:
gcc filename.c -nostartfiles (nostartfiles option tells the compiler to avoid standard linking)
- Interesting Facts About CSS
- Interesting Facts About PHP
- Unknown facts of Networking
- Interesting Infinite loop using characters in C
- Use of FLAG in programming
- Introduction to Programming Languages
- Generation of Programming Languages
- How to read Competitive Programming Questions?
- Print "GeeksforGeeks" in 10 different programming languages
- The complete History of Java Programming Language
- Draw a moving car using computer graphics programming in C
- Why is programming important for first year or school students?
- AKTU 1st Year Sem 1 Solved Paper 2016-17 | COMP. SYSTEM & C PROGRAMMING | Sec A
- AKTU 1st Year Sem 1 Solved Paper 2016-17 | COMP. SYSTEM & C PROGRAMMING | Sec C
- AKTU 1st Year Sem 2 Solved Paper 2017-18 | COMP. SYSTEM & C PROGRAMMING | Sec A
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.