C supports a variety of data types from "summary" of C Programming Language by Brian W. Kernighan,Dennis Ritchie
The language provides several basic data types, some of them (like int, float, char) are used in almost every program. Others are more specialized; for example, there are types for representing complex numbers, for booleans, for characters with "wide" characters, and for handling pointers. In addition, there are ways to construct arrays of any type, structures and unions, which allow a program to manipulate data in a way that fits the problem being solved. A structure is a mechanism for handling complex data items of different types, a union gives a way to handle a single item in several different ways. A struct or union is a composite type: a single variable name may denote a collection of members, each of which may be a structure or array or basic type. Pointers provide C with a powerful and flexible capability that is not found in most other languages. A pointer is a variable that contains the address of a variable of a particular type. The operator & gives the address of a variable, and the operator * provides access to the variable located at a particular address. The type of a pointer must be stated when it is declared; the type of the thing to which it points is not needed. Pointers are particularly important in dealing with arrays, structures, and complicated data structures. Pointers can also be used to pass information between functions. The language includes a set of operations that can be applied to the basic data types and to pointers, structures, and arrays that are constructed from them. Relational operators like < and == compare two values, yielding 1 if the relation is true, 0 if it is false. Logical operators like && (and), || (or), and ! (not) apply to integral operands and yield 1 if the relation is true, 0 if it is false. The conditional operator ?: provides a compact way to conditionally assign a value.Similar Posts
Comments are used to document code for clarity
Comments are used to document code for clarity. Comments can clarify the intent of the code so that others (or yourself) can un...
Understand the importance of debugging and testing
Debugging and testing are crucial aspects of software development that cannot be overlooked. These processes play a significant...
Familiarize yourself with the C/C++ standard libraries
To become a proficient C/C++ programmer, it is essential to have a good understanding of the standard libraries provided by the...
Macros can be used to define reusable code snippets
Macros are a powerful feature in C that can be used to define reusable code snippets. Instead of writing the same code over and...