C Programming Job Interview Questions and Answers – Page 3

C Programming Job Interview Questions and Answers – Page 3
Love and Share

20. What are destructors?

Answers : A destructor is a special method which is used to destroy the objects that have been created by constructors.

In general, A destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.

Some of the important action that a destructor makes is :

– they close the file/database connection.

– it does many kinds of housekeeping tasks

– Release network resources  etc.


21. What is character set?

Answers : Character set is the set of characters allowed and supported in the programming language. Generally, a program is a collection of instructions, which contain groups of characters. Only a limited set of characters is allowed to write instructions in the program.


22. What are the different types of C tokens?

Answers : The different types of C token Constants are:

  • Identifiers
  • Keywords
  • Operators
  • Special symbols
  • Strings.

23. What is a string?

Answers :  A string is a sequence of characters ending with NUL. It can be treated as a one–dimensional array of characters terminated by a NUL character.


24. What are qualifiers?

Answers :  A string is a sequence of characters ending with NUL. It can be treated as a one–dimensional array of characters terminated by a NUL character.

 


25. What are the different types of constants?

Answers :  There are five types of constants. They are :

  • Integer constants
  • Floating point constants
  • Character constants
  • String Literals
  • Enumeration constants

26. What are the rules for the identifier?

Answers :  Some of the important rules for the identifier are listed below:

  • Digits may be included in the variable
  • The first character must be an alphabet or underscore (_)
  • The maximum number of characters in a word are 32 (It may vary depending upon the platform)
  • No other special characters are allowed.

27. What is message passing?

Answers :  An object-oriented program consists of a set of objects that communicate with each other. Message passing involves specifying the name of the object, the name of the function and the information to be sent.


28. What is a macro?

Answers :  Macros are the identifiers that represent statements or expressions. To associate meaningful identifiers with constants, keywords, and statements or expressions.


29. What is a stack?

Answers : A stack is one form of a data structure. Data is stored in stacks using the FILO (First In Last Out) approach. At any particular instance, only the top of the stack is accessible, which means that in order to retrieve data that is stored in the stack, those on the upper part should be extracted first. Storing data in a stack is also referred to as a PUSH, while data retrieval is referred to as a POP.


30. What is the difference between #include‹ › and #include “ ”?

Answers : #include< > used for predefined header files Whereas #include  is used for user defined header files.

#include indicates that the headers are in the std C libraries installation folder Whereas #include< >   indicates the header files that the developed created, generally reside in the local folder.

Love and Share

Leave a Reply

Your email address will not be published. Required fields are marked *