Earn Money (Scholarships) By Posting Useful Content at our Forum |
|
Category Articles
What is forward reference w.r.t. pointers in c?
Added on Tue, Dec 15, 2009
int a=10; int *p=&a; *p is called forward Reference......... Read More
Who to know whether system uses big endian or little endian format and how to convert among them?
Added on Tue, Dec 15, 2009
Here is a small code segment to determine the endianess of a system at run time. short int number = 0x1; char * byte = (char*)&number; if ( byte[0] ) printf("Little endian"); else printf("Big endian"); Submitted by Pooja Agrawal ... Read More
How do you write a function which takes 2 arguments - a byte and a field in the byte and returns the value of the field in that byte?
Added on Tue, Dec 15, 2009
bool F1(int byte,int pos) { return( (bool)(byte & 1<<pos) } Read More
Can structures be passed to the functions by value?
Added on Tue, Dec 15, 2009
Yes, we can do it. consider the following code.. #include<stdio.h> #include<conio.h> struct emp { int no; int empno; }; typedef struct emp empdata; main() { empdata edata; void display( empdata ); clrscr(); edata.no = 1; edata... Read More
What are the 4 different types of inheritance relationship?
Added on Tue, Dec 15, 2009
4 levels: Single Multiple Multilevel Hybrid [Combination of the above types] Read More
What are the different qualifiers in C?
Added on Tue, Dec 15, 2009
1) Volatile: A variable should be declared volatile whenever its value could change unexpectedly. In practice, only three types of variables could change: ? Memory-mapped peripheral registers ? Global variables modified by an interrupt service... Read More
Advantages and disadvantages of using macro and inline functions?
Added on Tue, Dec 15, 2009
Advantage: Macros and Inline functions are efficient than calling a normal function. The times spend in calling the function is saved in case of macros and inline functions as these are included directly into the code. Disadvantage: Macros and... Read More
How is function itoa() written?
Added on Tue, Dec 15, 2009
#include<stdlib.h> #include<stdio.h> int main() { int n = 1234; char p[20]; itoa(n,s,10); printf("n=%d,s=%s",n,s); return 0; } Read More
Why cannot arrays be passed by values to functions?
Added on Tue, Dec 15, 2009
Arrays can't be passed by values. Because , the array name is evaluated to be a pointer to the first element of the array. e.g. when we pass array x, its equivalent to &x[0] i.e. pointer to the first element. Its type is, therefore, int *,... Read More
Which way of writing infinite loops is more efficient than others?
Added on Tue, Dec 15, 2009
while(1) {} It is the best way to implement infinite loop. Read More
#define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why?
Added on Tue, Dec 15, 2009
#define cat(x,y) x##y concatenates x to y. But cat(cat(1,2),3) does not expand but gives preprocessor warning. Why? in this case the cat(x,y) is the macro which is defined by using the preprocessor directive , this will be substituted only at the... Read More
What are the features different in pSOS and vxWorks?
Added on Tue, Dec 15, 2009
Actually theres not much of difference between using psos or vxworks.A few differences in features are: 1.The psos priority is reverse of vxworks. 2.psos supports posix 1003.1 while vxworks it is 1003.1b. 3.In psos device driver architecture is... Read More
malloc(sizeof(0)) will return ? valid pointer
Added on Tue, Dec 15, 2009
sizeof(0) returns the size of integer whose value is 0. Hence malloc would allocate sizeof(int) bytes and return a valid pointer. Read More
What happens when recursion functions are declared inline?
Added on Tue, Dec 15, 2009
inline function's property says whenever it will called, it will copy the complete definition of that function. Recursive function declared as inline creates the burden on the compiler's execution. The size of the stack may/may not be... Read More
++*ip increments what? it increments what ip points to
Added on Tue, Dec 15, 2009
++*ip will increment the value to which ip points. ex: *ip=3; ++*ip; printf("%d",*ip); the output will be 4 after this operation ip will point towards the same memory location. It doesn't increments the memory location in this... Read More
What will this return malloc(sizeof(-10))
Added on Tue, Dec 15, 2009
-10 is integer, so it return 4 bytes.... Read More
# error ? what it does?
Added on Tue, Dec 15, 2009
#error is the preprocessor directive which produces compile time error messages. These directives are most useful for detecting programmer inconsistencies and violation of constraints during preprocessing. Consider : #if !defined(__Cplusplus) ... Read More
What is interrupt latency? How can you recuce it?
Added on Tue, Dec 15, 2009
the time taken for the interrupt to active, at wat time it will relief from the interrupt Read More
When you inherit a class using private keyword which members of base class are visible to the derived class?
Added on Tue, Dec 15, 2009
protected & public members of the base class will be accessible in derived clas Read More
How is generic list manipulation function written which accepts elements of any kind?
Added on Tue, Dec 15, 2009
By the Template Class Read More
What is the output of printf(" abcd ef"); -> ef
Added on Tue, Dec 15, 2009
Output will be: efd Explaination : , and are escape sequences for new line, line feed and backspace respectively. Read More
What are the different storage classes in C?
Added on Tue, Dec 15, 2009
Generally four types of storage classes are there in c. 1.Auto 2. Register 3.Static 4.Extern or Global Read More
How would you find out the no of instance of a class?
Added on Tue, Dec 15, 2009
Declare a static variable( class level variable) in the class and increment it every time u create an instance of the class. There is also some method to find the number of instance of a class.... Read More
Can you have constant volatile variable?
Added on Tue, Dec 15, 2009
yes we can have constant volatile variable. In this current context of code will not change the value of the variable but out side of the program i.e. hardware registers can change it. Read More
How can you define a structure with bit field members?
Added on Tue, Dec 15, 2009
We can define structure bit field members with Dot operators. EXAMPLE: #include <stdio.h> int main() { Struct bit_field { Int x.4; // it allocates only 4 bits to x Char C.6; // it allocates only 6... Read More
What is the differnce between embedded systems and the system in which rtos is running?
Added on Tue, Dec 15, 2009
Embedded System: System which is designed to perform a single or few dedicated functions. System with RTOS: also can be an embedde system but naturally RTOS will be used in realtime system which will be need to perform many functions. Real time... Read More
Scope of static variables?
Added on Tue, Dec 15, 2009
Static variables exists until the end of the main() function/method Read More
Difference between object oriented and object based languages?
Added on Tue, Dec 15, 2009
object based languages doesn't support Inheritance where as object oriented supports. c# is a object oriented language because it supports inheritance and asp.net is not a langugae it is a technology If the language supports ony 3 features i;e ... Read More
What is the difference between hard real-time and soft real-time OS?
Added on Tue, Dec 15, 2009
Hard real-time system doesn't allow any delay. Eg;- Missiles Soft Real-time system allow some microseconds of delay. Eg:- Washing machines, Mobiles Read More
Is java a pure object oriented language? Why?
Added on Tue, Dec 15, 2009
No,Java is Not pure object oriented language as it supports primitive data types Read More
What is interrupt latency?
Added on Tue, Dec 15, 2009
Interrupt latency refers to the amount of time between when an interrupt is triggered and when the interrupt is seen by software. Read More
How many nuclear plants are there in India and what are they? which place they are located?
Added on Tue, Dec 15, 2009
Six Power plants are there in India, 1. TAPS (Tarapur Atomic Power Station), Tarapur, Maharastra 2. RAPS, Rawatbhata, Rajasthan 3. MAPS (Madras Atomic Power Station), Kalpakkam, Tamilnadu 4. NAPS Narora, Uttar Pradesh 5. KAPS Kakrapar, Gujarat ... Read More
|
|