Sei sulla pagina 1di 3

10/7/13

Todayznews.com View topic - Interview Questions and Answers On C and CPP - 5th Oct 2013

Todayznews.com
Right Place For Information Skip to content
Search Search

Advanced search Board index Placement Book Interview Questions with best answers Change font size Print view FAQ Register Login

Jobs in Dubai - 2013


www.bayt.com/jobs-in-dubai

All new jobs; all categories. Register & apply free!

Interview Questions and Answers On C and CPP - 5th Oct 2013


Post a reply
Search this topic Search

1 post Page 1 of 1

free Wi-Fi modem


shop.airtel.com/broadband

with high speed airtel broadband connection. Buy now online!

>Interview Questions and Answers On C and CPP - 5th Oct 2013


by radhika October 5th, 2013, 11:48 pm How c functions prevents rework and therefore saves the programers time as wel as length of the code ? As we know that c allows us to make functions and cal them where ever needed, it prevents rework by calling the same function again and again where ever requires intead for example if we make a funtion that adds two numbers, it can be called anywhere in the program where ever the addintion is needed and we do not need to code again for adding any
www.todayznews.com/viewtopic.php?f=14&t=320 1/3

10/7/13

Todayznews.com View topic - Interview Questions and Answers On C and CPP - 5th Oct 2013

number. It also shortens the length of the program as we do not need to code again the same thing for next time we can simple call the funtion and use it whenever needed.

What does an extern keyword mean in declaration? This keyword indicated that the function or the variable is implemented externally and it emphasizes that the variable ot the function exits external to the file or function. We use this keyword when we want to make anything global in the project, it does not lie within any function.

Can Union be self referenced? No, Union cannot be self referenced because it shares a single memory for all of its data members.

Define pointers? Pointes are special type of variables that are used to store the memory address of the other variables. Pointers are declared normallt as other variables withe diffrence of * that is present in front of the pointer identifier. There are two operators that are used with the pointers one is '&' and another one is '*'. & is known as address of operator and * is known as dereferncing operator, both are prefix unary operators.

Which format specifier is used for printing a pointer value? %p is used to dispaly the corresponding argument that is a pointer. %x can also be used to print values in hexadecimal form.

What is the use of 'auto' keyword ? The auto keyword declares a local variable whose scope remains within the bolck of code, it is a variable with the local scope. When we declare a variable with the auto keyword it specify that it belongs to an auto storage class. These variables are visible only within the bolck in which they are declared. These types of variables are not initialised automatically instead need to be initialised xplicitly

What is the use of register keyword with the variables? Register keyword signifies that of possible to store variable in the register than store it in register. Variables are usually stored in stacks and are passed to and fro to processor whenever required. Also register keyword when used redused code size which is an important thing in embeded system.

What do you mean by Global variables? These are the variables which remains visible throughout the program and are not recreated when they are recalled. These types are by default initialised to zero and allocated memory on Data Segment.

What do you mean by Static variables? Static is an access qualifier that limits the scope of the variable but causes the variable to exist for the lifetime of the
www.todayznews.com/viewtopic.php?f=14&t=320 2/3

10/7/13

Todayznews.com View topic - Interview Questions and Answers On C and CPP - 5th Oct 2013

program. This means a static variable is one that is not seen outside the function in which it is declared as its scopeis limited to the block of code in which it has been created but its lifespan remains until the program terminates. The value of such a variable will remain and may be seen even after calls to a function also the declaration statement of such type of a variable inside a function is executed only once.

What is the difference between global variables and static varables? The scope of the variable describes that the variable is accessible at certain point in the program or not. The difference between global variables and static variables lies in this concept only. The scope of the global variables remains through out the program also the life span of these variables is through out the program. The scope of the static Variables remains within the block of code in which they are created but the life span remains through out the program. Thus, the main difference is between the scope of both type of variables. radhika Posts: 300 Joined: September 20th, 2013, 2:03 pm Top Post a reply 1 post Page 1 of 1 Return to Interview Questions with best answers Jump to:
Interview Questions with best answers Go

Who is online
Users browsing this forum: No registered users and 5 guests Board index The team Delete all board cookies All times are UTC + 5:30 hours

www.todayznews.com/viewtopic.php?f=14&t=320

3/3

Potrebbero piacerti anche