Posts

Showing posts with the label stdio.h

Most efficient way to store flag values?

A flag is a value used to make a decision between two or more options in the execution of a program. For instance, the /w flag on the MS-DOS dir command causes the command to display filenames in several columns across the screen instead of displaying them one per line. In which a flag is used to indicate which of two possible types is held in a union. Because a flag has a small number of values (often only two), it is tempting to save memory space by not storing each flag in its own  int  or  char . Efficiency in this case is a tradeoff between size and speed. The most memory-space efficient way to store a flag value is as single bits or groups of bits just large enough to hold all the possible values. This is because most computers cannot address individual bits in memory, so the bit or bits of interest must be extracted from the bytes that contain it. The most time-efficient way to store flag values is to keep each in its own integer variable. Unfortunately, this method can w

How is the C language machine independent?

How is the C language machine independent? first of all c is  machine dependent  language, means we can not run a c program on another machine except in which it is programmed. machine independent  means source code of language can execute on any machine. ex java. View More

Why are header files needed in C?

Why are header files needed in C? Header file in any programming language used for including the library functions to that particular programming language. ex- stdio.h, conio.h, io.h and many more header files in c are used for including the library functions.