Advanced C Programming Exercises

Pointers
  1. Program to find variable’s address [Code]
  2. Program to show memory locations in an array [Code]
  3. Program to store addresses in pointer variables [Code]
  4. Program to list pointer sizes and locations [Code]
  5. Program to dereference pointer variables [Code]
  6. Program to pass an address to a function [Code]
  7. Program to use pointer arithmetic to access arrays [Code]
  8. Program that print arguments given to program at command-line [Code]
memory management
  1. Program to request and return dynamic memory [Code]
  2. Program to use the type cast operator [Code]
  3. Program to allocate a dynamic array [Code]
  4. Program to grow a dynamically allocated array [Code]
  5. Program to allocate and return memory from a function [Code]
WORKING WITH STRINGS
  1. Program to work with string pointers [Code]
  2. Program to determine the length of a string [Code]
  3. Program to perform concatenation [Code]
  4. Program to compare two strings [Code]
  5. Program to copy a string [Code]
  6. Program to sort a list of strings using pointers [Code]
FILE INPUT AND OUTPUT
  1. Program to open and close a file [Code]
  2. Program to write to a file [Code]
  3. Program to read from a file [Code]
  4. Program to parse file input [Code]
  5. Program to write to a binary file [Code]
  6. Program to read from binary files [Code]

 

fgets()

How to Use the fgets() Function for Text Input in C Programming [Link]
C fgets() Function: How to Fetch Strings from Anywhere [Link]