What are the ANSI reserved names in C?
I have given you a ANSI C reserved names and their uses given below:
%: This is used to printf()/scanf() format string.
is..or to..: Lowercase function names beginning with either is or to,where the next character also is a lowercase letter.
str..,mem..or wcs..: Lowercase function names beginning with either str, mem, or wcs, where the next character also is a lowercase letter
E: Macros that begin with an uppercase E
SIG.. or SIG_..: Macros that begin with either an uppercase SIG or SIG_
...f or ...l: Existing math library names with a trailing f or l
LC_: Macros that begin with an uppercase LC_Reply
What are the reserved Keywords?Explain it.
Some keywords are reserved in ANSI C.This keyword we can use as such they have given.Before using those keywords keep one thing in mind the are lowercase.Some main ANSI C reserved are given below:
asm: Begins assembly code and is not part of the ANSI standard.
FORTRAN: The entry follows FORTRAN calling conventions; FORTRAN
may be in lowercase for some implementations and
is not part of the ANSI standard.
PASCAL: The entry follows PASCAL calling conventions; PASCAL
may be in lowercase for some implementations and is not
part of the ANSI standard. Generally, the PASCAL conventions are identical to FORTRAN�s.
const: The variable will be used as a constant and will not be modified.
volatile: The compiler may make no assumptions about whether the
variable�s value is current. This keyword limits optimization,
and possibly slows program execution.
signed: The variable is a signed integer (with the actual size unspecified).
auto: The variable is created when the function is called, and is
discarded when the function exits. An auto variable is not initialized by the compiler.
continue: Passes control to the next iteration of a do(), for(), or while() statement.
enum: An integer defining a range of values. The actual internal representation of the value is not significant.
extern: The object is defined in a different source file.Reply
What do you understand about String?Explain it.
Basically C does not support an String.But C has many library functions using them we can over come that problem.
String are Array of type char.String constant(like: "this is our first string")can be consider as Character Array.Reply
What are the Array?How to define and declare them?
Basically Array are the collection of same data type.It has common name and addressed as a group.
Declaration of an Array:
We have to declare Array also as a single data object.
In this array of integers are created.Than first member in the array are addressed as Array and last member has been declared as Array.
#define MAX_SIZE 10
for (n = 1; n <= MAX_SIZE; n++)
Array[n] = n;
Definition of an Array:
We know that we declare an array like that,
When an array is external, it must be defined
in any other source files that may need to access it. Because you don�t want the compiler
to reallocate the storage for an array, you must tell the compiler that the array is allocated externally and that you want only to access the array.
How to define their types of variables and initialize them?
Variables are made by programmers.It can be modified.When we defined any data object as a singular variable can be defined also as an array.
In C variable are of many type. Like: an integer or character, or may be of compound data objects(Like: structure or unions).
Initialization of variable:
int num; //Here we declare num variable as integer and it is initialized as default size.
int num=0; //Here we declare num variable and initialize them with 0.Reply
How to differentiate b/n definition and declaration?
Some useful difference b/n definition and declaration are given below:
When define an object not only its attribute are made known,but its object are also created.Where as when we declare an object only its attribute are made known.
We define object like;
long int lSum;
long int lCount;
void SumInt(int nItem)
lSum =lSum + (long)nItem;
We declare an object like;
void VFunction(int nType)
nTest = nType;
What are the data type modifiers?
Some data types are to used to effect the characteristic of data object.These are called modifiers.Below i have shown you some modifiers:
Data type modifiers in C:
long: Forces a type int to be 4 bytes (32 bits) long and forces a type double to be larger than a double (but the actual size is implementation
short: Forces a type int to be 2 bytes (16 bits) long.
unsigned: Causes the compiler (and CPU) to treat the number as containing only positive values. Because a 16-bit signed integer can hold values between �32,768 and 32,767, an unsigned integer
can hold values between 0 and 65,535. The unsigned modifier can be used with char, long, and short (integer) types.
What do you understand about datatype?
C Language has supported many data types.Which we use writing program.C Language gave authority to programmers to create and use datatypes.
Below i have shown you list of basic data types.That are introduce by ANSI standard.
datatypes in C:
char: required 1 byte and it used for characters or integer variables.
int: required 2 or 4 bytes and it used for integer values.
float: required 4 bytes and it used for Floating-point numbers.
double: required 8 bytes and it used for Floating-point numbers. Reply
How to use functions fseek(), freed(), fwrite() and ftell()?
We can use fseek(),fread(),fwrite() and ftell() functions like that,
fseek(f,1,item)->Move the pointer for file f a distance 1 byte from location item.
fread(s,item1,item2,f)->Enter item2 data items,each of size item1 bytes,from file f to string s.
fwrite(s,item1,item2,f)->send item2 data items,each of size item1 bytes from string s to file f.
ftell(f)->Return the current pointer position within file f.
Functions fread,fseek and fwrite returned type is int and ftell is long int.Reply
Can you write function similar to printf()?
Here, we write a program similar to printf().
int printf(const char * restrict fmt, ...)
i = vfprintf(stdout, fmt, list);