Friday, June 14, 2013
Wednesday, August 29, 2012
Tuesday, August 14, 2012
UCOS-II FUNCTIONS
This Page contain valuable information regarding Ucos-II
Friday, July 27, 2012
INTERVIEW QUESTIONS
you can find lot of interview questions here
1). http://rasmiranjanbabuknols.wordpress.com/article/automotive-embedded-question-1gw91pqbwvttz-11/
2). http://kotipalli.wordpress.com/c-programming-dynamic-memory-allocation/
Wednesday, July 25, 2012
Little and BIG Endian
void main()
{
unsigned char test=0x01;
test=test<<1;
for more details visit
http://people.cs.umass.edu/~verts/cs32/endian.html
Sunday, May 13, 2012
About extern and static
About Extern and static .
Extern is the keyword give the linkage to another file to use the same variable .
Where as static is the keyword limit the linkage to internal . If we used the function name begin with static the scope of the variable is limited to internal.
#include <stdio.h>
int bar=34;
int main()
{
barTest();
printf("\n Bar in main---%d", bar);
return 0;
}// main file name is static1.c
#include <stdio.h>
extern int bar;
void barTest()
{
printf("\n Bar in barTest---%d", bar);
}// add.c subfile
output will be
Bar in barTest---34
Bar in main---34
Now change the program little bit
#include <stdio.h>
int bar=34;// changed
int main()
{
barTest();
printf("\n Bar in main---%d", bar);
return 0;
}// main file name is static1.c
#include <stdio.h>
static int bar=90;// changed hear
void barTest()
{
printf("\n Bar in barTest---%d", bar);
}// add.c subfile
output will be
Bar in barTest---90
Bar in main---34
int bar in add.c is limited to local to that file
now without both static as well as extern
At the time of linkage the this will produce error
Now come to function using static
#include <stdio.h>
int bar=34;
int main()
{
barTest();
printf("\n Bar in main---%d", bar);
return 0;
}// main file name is static1.c
#include <stdio.h>
extern int bar;
static void barTest()
{
printf("\n Bar in barTest---%d", bar);
}// add.c subfile
Now the void barTest is implicit to the file add.c if called from other file .
it will restrict access the compiler will give the error as “undefined reference to barTest”
Diiference between MACRO and CONST ?
MACRO
1.It is a replaces the test with a value
2.It value can't be altered but it is changed using pre-
processor derivative #undef .
3.once it is defined it is can't be localized like normal value
(same name can't used inside like local)
4.It is preprocessor directive it process all the value before it compile
CONST
1.it stored in ROM. we can using to other files of C using extern
that is not possible in MACRO.
2. It have address so we can use pointer as well as size of operator
3.It can be localized in side a function
4. it is optimized by compiler