Top C Language interview QA 1.Differences between C and Java? 1. C - TopicsExpress



          

Top C Language interview QA 1.Differences between C and Java? 1. C uses the top-down approach while JAVA uses the bottom-up approach. 2. JAVA is Object-Oriented while C is procedural. 3. Java is an Interpreted language while C is a compiled language. 4. C is a low-level language while JAVA is a high-level language. 5. C uses the top-down approach while JAVA uses the bottom-up approach. 6. Pointer go backstage in JAVA while C requires explicit handling of pointers. 7. JAVA supports Method Overloading while C does not support overloading at all. 8. Unlike C, JAVA does not support Preprocessors. 9. The standard Input & Output Functions--C uses the printf & scanf functions as its standard input & output while JAVA uses the System.out.print & System.in.read functions. 10. Exception Handling in JAVA And the errors & crashes in C. 2. In header files whether functions are declared or defined? Functions are declared within header file. That is function prototypes exist in a header file,not function bodies. They are defined in library (lib). 3. What are the different storage classes in C ? There are four types of storage classes in C. They are extern, register, auto and static 4. What does static variable mean? Static is an access qualifier. If a variable is declared as static inside a function, the scope is limited to the function,but it will exists for the life time of the program. Values will be persisted between successive calls to a function 5. What are macros? what are its advantages and disadvantages? Macros are processor directive which will be replaced at compile time. The advantage of macro is that it reduces the time taken for control transfer as in case of function. The disadvantage of it is here the entire code is substituted so the program becomes lengthy if a macro is called several times. 6.Difference between pass by reference and pass by value? Pass by value just passes the value from caller to calling function so the called function cannot modify the values in caller function. But Pass by reference will pass the address to the caller function instead of value if called function requires to modify any value it can directly modify. 7.What is an object? Object is a software bundle of variables and related methods. Objects have state and behavior 8.What is a class? Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class. 9.What is the difference between class and structure? Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public. Class: Class is a successor of Structure. By default all the members inside the class are private. 10. What is pointer? Pointer is a variable which store the address of another variable. 11.What is the difference between null and void pointer? A Null pointer has the value 0. void pointer is a generic pointer introduced by ANSI. Generic pointer can hold the address of any data type.
Posted on: Mon, 05 Aug 2013 04:37:00 +0000

Trending Topics



Recently Viewed Topics




© 2015