by Dinesh Thakur Category: Basic Of C Programming

The C standard library provides the executable code and declarations for functionality provided in it. The executable code for the library is provided in separate files, usually in the lib directory, in the installation directory of the compiler. The library files in Turbo C/C++ are named *.LIB, whereas those in the MinGW compiler provided with Dev-C++ and Code :: Blocks are named lib*. a.

 
by Dinesh Thakur Category: Basic Of C Programming

(i) It is a structured high-level language and is highly portable to different platforms.

(ii) C is closest to assembly language and hence it is extremely efficient. Some programmers call it "high-level assembly language", although it is not a justified comment.

 
by Dinesh Thakur Category: Basic Of C Programming

If you construct a long program today and try to recall it after a few days, there is every possibility that you would have forgotten quite a few things and even what the program does or what a particular name stands for. Comments if included in a program help in recollection of different names, data values and other parameters.

 
by Dinesh Thakur Category: Type And Variables

There are many different types of data values that are implicitly declared as constants in C. The value of a constant cannot be changed during execution of the program, neither by the programmer nor by the computer. The character 'A' is a constant having numerical value equal to 65 in decimal number system.



 
by Dinesh Thakur Category: Type And Variables

An expression is a combination of variables constants and operators written according to the syntax of C language. In C every expression evaluates to a value i.e., every expression results in some value of a certain type that can be assigned to a variable. Some examples of C expressions are shown in the table given below. 

 
by Dinesh Thakur Category: Type And Variables

An object is recognized by the computer by either its identifier or name. The object may be a variable of basic type or a function, a structure, or a union. The macro names and macro variables do not figure in the scope because macros are replaced by the preprocessor token sequences before the semantic phase of program translation. An identifier may also represent different objects in different scopes.



 
by Dinesh Thakur Category: Type And Variables

Both variables and the constants may have different types of values. In C language, different forms of data are categorized into a few abstract data types. For example, suppose you are asked to keep the record of the number of passengers in a bus. A variable say N, which is used to denote this number, will have value in whole numbers because the number of passengers cannot be a fractional number. Similarly, for number of students in a class, number of apples in a basket, number of pages in a book, or number of houses in a colony, etc., the values must be in whole numbers. Whole numbers form a category called integers. In C language, this type is coded as int, a short form for integer.



 
by Dinesh Thakur Category: Type And Variables

Declaration of a variable in C hints the compiler about the type and size of the variable in compile time. Similarly, declaration of a function hints about type and size of function parameters. No space is reserved in memory for any variable in case of declaration.

 
by Dinesh Thakur Category: Type And Variables

Extern variables: belong to the External storage class and are stored in the main memory. extern is used when we have to refer a function or variable that is implemented in other file in the same project. The scope of the extern variables is Global.

 
by Dinesh Thakur Category: Type And Variables

Register variables: belong to the register storage class and are stored in the CPU registers. The scope of the register variables is local to the block in which the variables are defined. The variables which are used for more number of times in a program are declared as register variables for faster access.



 
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content