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);
IF **p and &(*p) are same, than tell how?
No, **p and &(*P) are not same. Because of &(*P) is used to point the address of variable that was stored in p.Where as **p is used to point the pointer to the another pointer. Reply
How the processor registers can be used in C?
using keyword register we can use the process register in C.Basically process register is used to store variables those i want to access frequently.if these registers are not used in any other program,then those registers we used to
allocate memory these variables.Reply
What is an volatile variable?
We can not modify the variable which is declare to volatile during execution of whole program.
volatile int i = 10;
value of i can not be changed at run time.
How to access or modify the constt variable in C ?
We can not modify the constant variable.Reply