All About C Topics
All About C Topics
1. Data Types in C
2. Use of bool in C
3. Integer Promotions in C
4. Quiz on Data Types in C
5. Comparison of a float with a value in C
6. Need of long data type in C
7. size_t data type in C
8. Interesting facts about data-types and modifiers
9. Float and Double in C
10. Character arithmetic in C
11. Typecasting in C
Storage Classes:
1. Storage Classes in C
2. Static Variables in C
3. Understanding “extern” keyword in C
4. What are the default values of static variables in C?
5. Understanding “volatile” qualifier in C
6. Const Qualifier in C
7. Initialization of static variables in C
8. Understanding “register” keyword in C
9. Quiz on Storage Classes in C
10. Understanding volatile qualifier in C- Set 1
Input/Output:
1. Returned values of printf() and scanf()
2. What is return type of getchar(), fgetc() and getc() ?
3. Scansets in C
4. puts() vs printf() for printing a string
5. What is use of %n in printf() ?
6. How to print % using printf()?
7. Quiz on Input Output in C
8. Difference between printf, sprintf and fprintf?
9. Difference between getc(), getchar(), getch() and getche()
10. Difference between %d and %i format specifier
11. Use of fflush(stdin) in C
12. Clearing input buffer in C/C++
13. scanf() and fscanf() in C
14. getchar_unlocked() in C
15. Problem with scanf()
16. Differentiate printable and control character
17. rand() and srand() in C/C++
Operators:
1. Introduction to operators in C and Arithmetic Operators
2. Relational and Logical Operators in C
3. Bitwise Operators in C
4. Operator Precedence and Associativity in C
5. Evaluation order of operands
6. Comma in C and C++
7. sizeof operator in C
8. Operands for sizeof operator
9. A comma operator question
10. Result of comma operator as l-value in C and C++
11. Order of operands for logical operators
12. Increment (Decrement) operators require L-value Expression
13. Precedence of postfix ++ and prefix ++ in C/C++
14. Modulus on Negative Numbers
15. C/C++ Ternary Operator – Some Interesting Observations
16. Pre-increment (or pre-decrement) in C++
17. Difference between ++*p, *p++ and *++p
18. Results of comparison operations in C and C++
19. To find sum of two numbers without using any operator
20. Sequence Points in C
21. Execution of printf with ++ operators
22. Anything written in sizeof() is never executed
23. Difference between strlen() and sizeof()
24. Stringizing and Token-pasting operator
Preprocessor:
1. Write a C macro PRINT(x) which prints x
2. Variable length arguments for Macros
3. Multiline macros in C
4. CRASH() macro – interpretation
5. The OFFSETOF() macro,
6. Branch prediction macros in GCC
7. Diffference between #define and const in C?
8. A C Programming Language Puzzle
9. What’s difference between header files “stdio.h” and “stdlib.h” ?
10. How to print a variable name in C?
11. Constants in C
12. How a Preprocessor works
13. Preprocessor Directives : Behind the scene-1
14. Preprocessor Directives : Behind the scene-2
15. isgraph() library function
16. write your own header file in C
17. difftime() library function
18. tmpnam() library function
19. _Generic keyword in C
20. math.h library functions
21. typedef versus #define in C
22. strftime() library function
23. exec family of functions
Control Statements:
1. What should be data type of case labels of switch statement in C?
2. For Versus While
3. A nested loop puzzle
4. switch statement in C
5. Difference between while(1) and while(0)
6. goto statement
7. Continue Statement
8. Break Statement
9. Using range in switch case
Functions:
1. Functions in C
2. Importance of function prototype in C
3. Functions that are executed before and after main() in C
4. return statement vs exit() in main()
5. How to Count Variable Numbers of Arguments in C?,
6. What is evaluation order of function parameters in C?
7. Does C support function overloading?
8. How can we return multiple values from a function?
9. What is the purpose of a function prototype?
10. Static functions in C
11. exit(), abort() and assert()
12. Implicit return type int in C
13. What happens when a function is called before its declaration in C?
14. _Noreturn function specifier in C
15. exit() vs _Exit()
16. __func__ identifier in C
17. Callback function in C
18. Nested functions in C
19. Parameter Passing Techniques
20. pow() function in C
21. tolower() function in C
22. time() function in C
Pointers:
1. Introduction to pointers in C and C++
2. Double Pointer (Pointer to Pointer) in C
3. Why C treats array parameters as pointers?
4. Output of the program | Dereference, Reference, Dereference, Reference
5. Dangling, Void , Null and Wild Pointers
6. An Uncommon representation of array elements
7. How to declare a pointer to a function?
8. Pointer vs Array in C
9. void pointer in C
10. NULL pointer in C !
11. Function Pointer in C
12. near, far and huge pointers
13. Generic Linked List in C
14. restrict keyword in C
15. const char *p, char * const p and const char * const p
16. Pointer to an Array
Memory Management:
1. Memory Layout of C Programs,
2. How to deallocate memory without using free() in C?
3. calloc() versus malloc()
4. How does free() know the size of memory to be deallocated?
5. Use of realloc()
6. What is Memory Leak? How can we avoid?
File Handling:
1. fseek() vs rewind() in C
2. EOF, getc() and feof() in C
3. fopen() for an existing file in write mode
4. Read/Write structure to a file
5. fgets() and gets() in C
6. Basics of File Handling
7. fsetpos() in C
8. rename function in C/C++
9. tmpfile() function in C
10. fgetc() and fputc() in C
11. fseek() in C/C++
12. ftell() in C
13. lseek() in C/C++
14. remove function in C/C++
15. Merge contents of two files into a third file
16. Print contents of file in C
Puzzles:
1. C Program to print numbers from 1 to N without using semicolon?
2. How to find sum of two numbers without using any operator
3. How will you show memory representation of C variables?
4. Condition To Print “HelloWord”
5. Change/add only one character and print ‘*’ exactly 20 times
6. How can we sum the digits of a given number in single statement?
7. What is the best way in C to convert a number to a string?
8. Calculate Logn in one line
9. Print “Even” or “Odd” without using Conditional statement
10. How will you print numbers from 1 to 100 without using loop?
11. How can we sum the digits of a given number in single statement?
12. How will you print “Geeks for Geeks” without using a semicolon
13. Write a one line C function to round floating point numbers
14. How will implement Your Own sizeof
15. How to count set bits in a floating point number in C?
16. How to change the output of printf() in main() ?
17. How to find length of a string without string.h and loop in C?
18. Implement your own itoa()
19. Write a C program that does not terminate when Ctrl+C is pressed
20. How to measure time taken by a function in C?
21. Print a long int in C using putchar() only
22. Convert a floating point number to string in C
23. How to write a running C code without main()?
24. Write your own memcpy()
25. C program to print characters without using format specifiers
26. C program to print a string without any quote (singe or double) in the program
27. Execute both if and else statements simultaneously
28. Print “Hello World” without using any header file
Misc:
1. Quine – A self-reproducing program
2. Complicated declarations in C
3. Use of bool in C
4. Sequence Points in C | Set 1
5. Optimization Techniques | Set 2 (swapping),
6. ASCII NUL, ASCII 0 (’0?) and Numeric literal 0
7. Little and Big Endian Mystery,
8. Comparator function of qsort() in C
9. Program to validate an IP address
10. Multithreading in C
11. Assertions in C/C++
12. fork() in C
13. Interesting Facts in C Programming
14. Precision of floating point numbers in C++ (floor(), ceil(), trunc(), round() and setprecision())
15. setjump() and longjump() in C
16. nextafter() and nexttoward() in C/C++
17. pthread_cancel() in C
18. pthread_equal() in C
19. pthread_self() in C
20. Local Labels in C
21. lvalue and rvalue in C
22. Get and set the stack size of thread attribute
23. Difference between fork() and exec()
24. Errors in C/C++
25. Why is C considered faster than other languages
26. Incompatibilities between C and C++
27. Convert C/C++ code to assembly language
28. Error Handling in C
29. Executing main() in C/C++ : Behind the scene
30. Hygienic Macros in C
31. Command line arguments in C/C++
32. scanf(), fscanf(), sscanf(), scanf_s(), fscanf_s(), sscanf_s()
33. Some Interesting Facts in C Programming
34. Database Connectivity using C/C++
35. Function Interposition in C
36. Macros vs Functions
37. Write your own memcpy() and memmove()