C and C++ Programming Resources | C & C++ Code Example Index | C++ Code Example Index

 

 

The C struct, typedef, union, enum and command line argument Sample Codes Index Page

 

 

 

 

 

 

 

The following links provide code samples on how to use the C and C++ aggregate types such as union, struct, enum and typedef. The second part provides links to the program example of the main() function and its command line arguments.

 

 

C and C++ Struct, Typedef, Union, Enum (The C & C++ struct, typedef, union, enum code examples)

  1. The union aggregate type C++ program example

  2. Displaying the union members' values and showing its weakness compared to struct type

  3. Displaying days from enum data type, resetting the sequence order

  4. Assigning name to the integer value using enum type code sample

  5. Displaying the day from the enum data type program example

  6. Displaying days in numbers representation using enumeration (enum) type

  7. Passing structures to functions and a function returning a struct program example

  8. Reading and writing student data using an array of struct type

  9. How to use struct pointer operators, accessing the struct elements different ways

  10. Accessing the struct element program example

  11. Accessing and displaying the struct members

  12. Enumeration using enum - displaying the integer for the respective string

  13. The typedef and struct - simplifying the name of the struct definition

  14. Printing student ID and name using struct aggregate type

C and C++ for main() and Command Line Arguments (The C & C++ command line arguments program samples)

  1. The C++ Command line and switches program example

  2. Searching a simple text pattern read from standard input and write to standard output program example

  3. How to create console application that demonstrates the use of main() and command line argument

  4. The main() function and command line arguments with switches/options

  5. Searching a text pattern program skeleton done by main() and command line argument code sample

  6. Working program example on searching a text pattern in the command line argument read from standard input

  7. Echoing back the user input to standard output, read from the command line argument (standard input)

  8. A very simple main() and command line arguments C program example

 

 

 

C and C++ Programming Resources | C & C++ Code Example Index | C++ Code Example Index