C, C++ Interview Questions Part - 1

ReKruiTIn.com
ReKruiTIn.comReKruiTIn.com
www.rekruitin.com
C, C++ Interview Questions
Part - 1
Page  2
1. What is C++?
Released in 1985, C++ is an object-oriented programming language created
by Bjarne Stroustrup. C++ maintains almost all aspects of the C language,
while simplifying memory management and adding several features -
including a new datatype known as a class (you will learn more about these
later) - to allow object-oriented programming. C++ maintains the features of C
which allowed for low-level memory access but also gives the programmer
new tools to simplify memory management.
C++ used for:
C++ is a powerful general-purpose programming language. It can be used to
create small programs or large applications. It can be used to make CGI
scripts or console-only DOS programs. C++ allows you to create programs to
do almost anything you need to do. The creator of C++, Bjarne Stroustrup,
has put together a partial list of applications written in C++.
Page  3
2. How do you find out if a linked-list has an end? (i.e. the list is not a
cycle)?
You can find out by using 2 pointers. One of them goes 2 nodes each time.
The second one goes at 1 nodes each time. If there is a cycle, the one that
goes 2 nodes each time will eventually meet the one that goes slower. If that
is the case, then you will know the linked-list is a cycle.
3. What is the difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the
malloc subroutine. Undefined results occur if the Pointer parameter is not a
valid pointer. If the Pointer parameter is a null value, no action will occur.
The realloc subroutine changes the size of the block of memory pointed to
by the Pointer parameter to the number of bytes specified by the Size
parameter and returns a new pointer to the block. The pointer specified by
the Pointer parameter must have been created with the malloc, calloc, or
realloc subroutines and not been deallocated with the free or realloc
subroutines. Undefined results occur if the Pointer parameter is not a valid
pointer.
Page  4
4. What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be
defined, as long as these functions have different sets of parameters (at least as
far as their types are concerned). This capability is called function overloading.
When an overloaded function is called, the C++ compiler selects the proper
function by examining the number, types and order of the arguments in the call.
Function overloading is commonly used to create several functions of the same
name that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they
work on objects of user-defined classes.
Overloaded operators are syntactic sugar for equivalent function calls. They
form a pleasant facade that doesn't add anything fundamental to the language
(but they can improve understandability and reduce maintenance costs).
Page  5
5. What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the
definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function body
cout << *;
cout << endl; }
6. What are the advantages of inheritance?
It permits code reusability. Reusability saves time in program development. It
encourages the reuse of proven and debugged high-quality software, thus reducing
problem after a system becomes functional.
Page  6
7. Define Storage Classes and explain application domain?
Register: tell to the compiler for use a CPU register for fast aceess for that
variable.
Auto: It's a variable created and initialized when it is defined. It is not visible
outside of the block.
Static: defined inside of the function retain its value between calls. Always is
initialized with 0. Defined as global in a file is visible on for the functions from that
file.
Extern : The definition of the variable is in another file.
8. Define a "dangling" pointer?
Dangling pointer is obtained by using the address of an object which was freed.
9. Any difference between "const int*ptr" and int *const ptr" ?
Yes, it's a major difference. First define a constant data and second define a
constant pointer.
Page  7
10. Define the Storage Qualifiers?
const - define a variable that can not change its value along the program
execution.
volatile - define a variable that can be changed indirectly. An example can
be a counter register that is updated by hardware.
mutuable - a member of a structure or object can be changed even if the
structure, for example is declared const:
Ex: struct complex {mutuable int x; int y;};
const complex Mycomplex = {1, 2};
Mycomplex.x = 3; /* correct */
11. Does c++ support multilevel and multiple inheritance?
Yes.
Page  8
12. What is the difference between an ARRAY and a LIST?
Array is collection of homogeneous elements.
List is collection of heterogeneous elements.
For Array memory allocated is static and continuous.
For List memory allocated is dynamic and Random.
Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.
13. Define a constructor - What it is and how it might be called.
constructor is a member function of the class, with the name of the function
being the same as the class name. It also specifies how the object should be
initialized.
Ways of calling constructor:
1) Implicitly: automatically by complier when an object is created.
2) Calling the constructors explicitly is possible, but it makes the code
unverifiable.
Page  9
14. What is a template?
Templates allow to create generic functions that admit any data type as
parameters and return value without having to overload the function with all
the possible data types. Until certain point they fulfill the functionality of a
macro. Its prototype is any of the two following ones:
template <class indetifier> function_declaration; template <typename
indetifier> function_declaration;
The only difference between both prototypes is the use of keyword class or
typename, its use is indistinct since both expressions have exactly the same
meaning and behave exactly the same way.
15. What is RTTI?
Runtime type identification (RTTI) lets you find the dynamic type of an object
when you have only a pointer or a reference to the base type. RTTI is the
official way in standard C++ to discover the type of an object and to convert
the type of a pointer or reference (that is, dynamic typing). The need came
from practical experience with C++. RTTI replaces many Interview Questions
- Homegrown versions with a solid, consistent approach.
Page  10
16. How can you tell what shell you are running on UNIX system?
You can do the Echo $RANDOM. It will return a undefined variable if you are
from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5
digit random numbers if you are from the Korn shell. You could also do a ps -l
and look for the shell with the highest PID.
17. What do you mean by inheritance?
Inheritance is the process of creating new classes, called derived classes, from
existing classes or base classes. The derived class inherits all the capabilities of
the base class, but can add embellishments and refinements of its own.
18. What is Boyce Codd Normal form?
A relation schema R is in BCNF with respect to a set F of functional
dependencies if for all functional dependencies in F+ of the form a-> , where a
and b is a subset of R, at least one of the following holds:
* a- > b is a trivial functional dependency (b is a subset of a)
* a is a superkey for schema R
Page  11
19. What is namespace?
Namespaces allow us to group a set of global classes, objects and/or
functions under a name.
To say it somehow, they serve to split the global scope in sub-scopes known
as namespaces.
The form to use namespaces is:
namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of
classes, objects and functions that are included within the namespace. For
example:
namespace general { int a, b; }
In this case, a and b are normal variables integrated within the general
namespace. In order to access to these variables from outside the
namespace we have to use the scope operator ::.
For example, to access the previous variables we would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a
possibility that a global object or function can have the same name than
another one, causing a redefinition error.
Page  12
20. What do you mean by binding of data and functions?
Encapsulation.
21. What are virtual functions?
A virtual function allows derived classes to replace the implementation
provided by the base class.
The compiler makes sure the replacement is always called whenever the
object in question is actually of the derived class, even if the object is
accessed by a base pointer rather than a derived pointer. This allows
algorithms in the base class to be replaced in the derived class, even if users
don't know about the derived class.
22. What is the difference between an external iterator and an internal
iterator? Describe an advantage of an external iterator.
An internal iterator is implemented with member functions of the class that
has items to step through. .An external iterator is implemented as a separate
class that can be "attach" to the object that has items to step through
.An external iterator has the advantage that many difference iterators can be
active simultaneously on the same object.
Page  13
23. What is an HTML tag? 
An HTML tag is a syntactical construct in the HTML language that 
abbreviates specific instructions to be executed when the HTML script is 
loaded into a Web browser. 
It is like a method in Java, a function in C++, a procedure in Pascal, or a 
subroutine in FORTRAN.
24. How do you decide which integer type to use?
 
It depends on our requirement. 
When we are required an integer to be stored in 1 byte (means less than or 
equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long 
int. 
A char is for 1-byte integers, a short is for 2-byte integers, an int is generally 
a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer, 
and a long long is a 8-byte integer.
25.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.
Page  14
For more details, Please log on to www.rekruitin.com
Customer Care : 8855041500
Career Guidance : 9823205144
Tech Support : 7758806112
Human Resource: 9823204144
You can also Find us on:
15
Thank You !!!
1 sur 15

Recommandé

C programming interview questionsC programming interview questions
C programming interview questionsadarshynl
14.7K vues22 diapositives
88 c-programs88 c-programs
88 c-programsLeandro Schenone
953 vues296 diapositives
Solid C++ by ExampleSolid C++ by Example
Solid C++ by ExampleOlve Maudal
20.4K vues204 diapositives
Deep CDeep C
Deep COlve Maudal
871.4K vues445 diapositives

Contenu connexe

Tendances(20)

Clean coding-practicesClean coding-practices
Clean coding-practices
John Ferguson Smart Limited32.8K vues
Files in c++ pptFiles in c++ ppt
Files in c++ ppt
Kumar 11.5K vues
Clean codeClean code
Clean code
Arturo Herrero69.9K vues
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
Shuvongkor Barman14.2K vues
Clean codeClean code
Clean code
Henrique Smoco509 vues
FUNCTIONS IN c++ PPTFUNCTIONS IN c++ PPT
FUNCTIONS IN c++ PPT
0306267992925.2K vues
constructors and destructors in c++constructors and destructors in c++
constructors and destructors in c++
HalaiHansaika1.1K vues
OOP in C++OOP in C++
OOP in C++
ppd19616.5K vues
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
Kamal Acharya6.3K vues
7 rules of simple and maintainable code7 rules of simple and maintainable code
7 rules of simple and maintainable code
Geshan Manandhar2.7K vues
Exception Handling in C++Exception Handling in C++
Exception Handling in C++
Deepak Tathe1.8K vues
Clean code slideClean code slide
Clean code slide
Anh Huan Miu2.1K vues
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
MOHIT TOMAR2.4K vues
C++ Programming CourseC++ Programming Course
C++ Programming Course
Dennis Chang4.9K vues
C++11 & C++14C++11 & C++14
C++11 & C++14
CyberPlusIndia1.4K vues
C# conventions & good practicesC# conventions & good practices
C# conventions & good practices
Tan Tran15.9K vues

En vedette(19)

C++ questions and answersC++ questions and answers
C++ questions and answers
Deepak Singh5.7K vues
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
lavparmar00716.6K vues
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
Sareen Kumar1.9K vues
C interview question answer 2C interview question answer 2
C interview question answer 2
Amit Kapoor22.4K vues
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
Kushaal Singla2.7K vues
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
versabit technologies30.1K vues
C interview Question and AnswerC interview Question and Answer
C interview Question and Answer
Jagan Mohan Bishoyi283 vues
Geometry formula sheetGeometry formula sheet
Geometry formula sheet
sidraqasim9963.3K vues
Algebra formulas Algebra formulas
Algebra formulas
Matthew McKenzie40.2K vues
Geometry formula-sheetGeometry formula-sheet
Geometry formula-sheet
adheera dra133K vues
Probability Formula sheetProbability Formula sheet
Probability Formula sheet
Haris Hassan17.4K vues
Notes and-formulae-mathematicsNotes and-formulae-mathematics
Notes and-formulae-mathematics
Ragulan Dev61.9K vues
Research method - How to interview?Research method - How to interview?
Research method - How to interview?
Hafizah Hajimia25.4K vues
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
iimjobs and hirist50.9K vues

Similaire à C, C++ Interview Questions Part - 1

Interoduction to c++Interoduction to c++
Interoduction to c++Amresh Raj
275 vues21 diapositives
Technical InterviewTechnical Interview
Technical Interviewprashant patel
621 vues55 diapositives

Similaire à C, C++ Interview Questions Part - 1(20)

C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
Jagan Mohan Bishoyi307 vues
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj275 vues
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
SRamadossbiher17 vues
Technical InterviewTechnical Interview
Technical Interview
prashant patel621 vues
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
AniketBhandare267 vues
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak16.6K vues
C questionsC questions
C questions
parm112853 vues
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kella
Manoj Kumar kothagulla161 vues
My c++My c++
My c++
snathick3.7K vues
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
Preeti Kashyap128 vues
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
rashmita_mishra1.6K vues
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
Indira Gnadhi National Open University (IGNOU)636 vues
Unit  1Unit  1
Unit 1
donny101220 vues
InterviesIntervies
Intervies
roopa manoharan1.1K vues
C interview questionsC interview questions
C interview questions
Soba Arjun70 vues
interview questions.docxinterview questions.docx
interview questions.docx
SeoTechnoscripts2 vues
SRAVANByCPPSRAVANByCPP
SRAVANByCPP
aptechsravan279 vues
C# Unit 2 notesC# Unit 2 notes
C# Unit 2 notes
Sudarshan Dhondaley1.8K vues

Plus de ReKruiTIn.com

Tips on Group DiscussionTips on Group Discussion
Tips on Group DiscussionReKruiTIn.com
1.9K vues16 diapositives
Team managementTeam management
Team managementReKruiTIn.com
1.4K vues15 diapositives
Importance of Cover LetterImportance of Cover Letter
Importance of Cover LetterReKruiTIn.com
2.6K vues12 diapositives

Plus de ReKruiTIn.com(16)

Tips On Telephonic Interview RoundTips On Telephonic Interview Round
Tips On Telephonic Interview Round
ReKruiTIn.com1K vues
What not to Include in your Resume.What not to Include in your Resume.
What not to Include in your Resume.
ReKruiTIn.com466 vues
Tips for Salary NegotiationTips for Salary Negotiation
Tips for Salary Negotiation
ReKruiTIn.com936 vues
Tips on Group DiscussionTips on Group Discussion
Tips on Group Discussion
ReKruiTIn.com1.9K vues
Team managementTeam management
Team management
ReKruiTIn.com1.4K vues
Importance of Cover LetterImportance of Cover Letter
Importance of Cover Letter
ReKruiTIn.com2.6K vues
Mistakes to avoid in  Job InterviewMistakes to avoid in  Job Interview
Mistakes to avoid in Job Interview
ReKruiTIn.com2.1K vues
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
ReKruiTIn.com2.3K vues
Sap Interview Questions - Part 1Sap Interview Questions - Part 1
Sap Interview Questions - Part 1
ReKruiTIn.com1.4K vues
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1
ReKruiTIn.com1.3K vues
Resume Writing SkillsResume Writing Skills
Resume Writing Skills
ReKruiTIn.com916 vues
Interview ProcessInterview Process
Interview Process
ReKruiTIn.com6.2K vues
Recruitment skillsRecruitment skills
Recruitment skills
ReKruiTIn.com5.2K vues
Basic Interview QuestionsBasic Interview Questions
Basic Interview Questions
ReKruiTIn.com1.7K vues
Career Development TipsCareer Development Tips
Career Development Tips
ReKruiTIn.com1.2K vues

Dernier(20)

TRIBUTES.pptxTRIBUTES.pptx
TRIBUTES.pptx
RomeoAcquah18 vues
Readiness Quiz - Sr. Engineer.pptxReadiness Quiz - Sr. Engineer.pptx
Readiness Quiz - Sr. Engineer.pptx
guptanavneet1362 vues
Barefoot Ad Copy.pdfBarefoot Ad Copy.pdf
Barefoot Ad Copy.pdf
sarahelizalydon20 vues
How do Hackers get Password.pdfHow do Hackers get Password.pdf
How do Hackers get Password.pdf
Bytecode Security6 vues
Sightless opening analysisSightless opening analysis
Sightless opening analysis
ImanFatima15595210 vues
IIBA Melbourne - Pave your Path to Success IIBA Melbourne - Pave your Path to Success
IIBA Melbourne - Pave your Path to Success
AustraliaChapterIIBA29 vues
Christy Joy Acuna.pdfChristy Joy Acuna.pdf
Christy Joy Acuna.pdf
Christy Joy Acuna7 vues
PROGRAMME.pdfPROGRAMME.pdf
PROGRAMME.pdf
HiNedHaJar19 vues
Media Pitch Example.pdfMedia Pitch Example.pdf
Media Pitch Example.pdf
sarahelizalydon34 vues
Social Post Calendar Barefoot.pdfSocial Post Calendar Barefoot.pdf
Social Post Calendar Barefoot.pdf
sarahelizalydon20 vues
Scrum Quiz CertificationScrum Quiz Certification
Scrum Quiz Certification
Vivek Nair5 vues
SEOSEO
SEO
afroza12048420 vues
Project & Portfolio 1Project & Portfolio 1
Project & Portfolio 1
jaspam256 vues
Dr GGS CV Final.docxDr GGS CV Final.docx
Dr GGS CV Final.docx
Ambuj Saxena10 vues
Massage Envy Campaign Highlights.pdfMassage Envy Campaign Highlights.pdf
Massage Envy Campaign Highlights.pdf
sarahelizalydon34 vues

C, C++ Interview Questions Part - 1

  • 2. Page  2 1. What is C++? Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management. C++ used for: C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.
  • 3. Page  3 2. How do you find out if a linked-list has an end? (i.e. the list is not a cycle)? You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle. 3. What is the difference between realloc() and free()? The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.
  • 4. Page  4 4. What is function overloading and operator overloading? Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).
  • 5. Page  5 5. What is the difference between declaration and definition? The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarator { for(int j=10; j > =0; j--) //function body cout << *; cout << endl; } 6. What are the advantages of inheritance? It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
  • 6. Page  6 7. Define Storage Classes and explain application domain? Register: tell to the compiler for use a CPU register for fast aceess for that variable. Auto: It's a variable created and initialized when it is defined. It is not visible outside of the block. Static: defined inside of the function retain its value between calls. Always is initialized with 0. Defined as global in a file is visible on for the functions from that file. Extern : The definition of the variable is in another file. 8. Define a "dangling" pointer? Dangling pointer is obtained by using the address of an object which was freed. 9. Any difference between "const int*ptr" and int *const ptr" ? Yes, it's a major difference. First define a constant data and second define a constant pointer.
  • 7. Page  7 10. Define the Storage Qualifiers? const - define a variable that can not change its value along the program execution. volatile - define a variable that can be changed indirectly. An example can be a counter register that is updated by hardware. mutuable - a member of a structure or object can be changed even if the structure, for example is declared const: Ex: struct complex {mutuable int x; int y;}; const complex Mycomplex = {1, 2}; Mycomplex.x = 3; /* correct */ 11. Does c++ support multilevel and multiple inheritance? Yes.
  • 8. Page  8 12. What is the difference between an ARRAY and a LIST? Array is collection of homogeneous elements. List is collection of heterogeneous elements. For Array memory allocated is static and continuous. For List memory allocated is dynamic and Random. Array: User need not have to keep in track of next memory allocation. List: User has to keep in Track of next location where memory is allocated. 13. Define a constructor - What it is and how it might be called. constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. Ways of calling constructor: 1) Implicitly: automatically by complier when an object is created. 2) Calling the constructors explicitly is possible, but it makes the code unverifiable.
  • 9. Page  9 14. What is a template? Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones: template <class indetifier> function_declaration; template <typename indetifier> function_declaration; The only difference between both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way. 15. What is RTTI? Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or a reference to the base type. RTTI is the official way in standard C++ to discover the type of an object and to convert the type of a pointer or reference (that is, dynamic typing). The need came from practical experience with C++. RTTI replaces many Interview Questions - Homegrown versions with a solid, consistent approach.
  • 10. Page  10 16. How can you tell what shell you are running on UNIX system? You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID. 17. What do you mean by inheritance? Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own. 18. What is Boyce Codd Normal form? A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a-> , where a and b is a subset of R, at least one of the following holds: * a- > b is a trivial functional dependency (b is a subset of a) * a is a superkey for schema R
  • 11. Page  11 19. What is namespace? Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say it somehow, they serve to split the global scope in sub-scopes known as namespaces. The form to use namespaces is: namespace identifier { namespace-body } Where identifier is any valid identifier and namespace-body is the set of classes, objects and functions that are included within the namespace. For example: namespace general { int a, b; } In this case, a and b are normal variables integrated within the general namespace. In order to access to these variables from outside the namespace we have to use the scope operator ::. For example, to access the previous variables we would have to put: general::a general::b The functionality of namespaces is specially useful in case that there is a possibility that a global object or function can have the same name than another one, causing a redefinition error.
  • 12. Page  12 20. What do you mean by binding of data and functions? Encapsulation. 21. What are virtual functions? A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class. 22. What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator. An internal iterator is implemented with member functions of the class that has items to step through. .An external iterator is implemented as a separate class that can be "attach" to the object that has items to step through .An external iterator has the advantage that many difference iterators can be active simultaneously on the same object.
  • 13. Page  13 23. What is an HTML tag?  An HTML tag is a syntactical construct in the HTML language that  abbreviates specific instructions to be executed when the HTML script is  loaded into a Web browser.  It is like a method in Java, a function in C++, a procedure in Pascal, or a  subroutine in FORTRAN. 24. How do you decide which integer type to use?   It depends on our requirement.  When we are required an integer to be stored in 1 byte (means less than or  equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long  int.  A char is for 1-byte integers, a short is for 2-byte integers, an int is generally  a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer,  and a long long is a 8-byte integer. 25.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.
  • 14. Page  14 For more details, Please log on to www.rekruitin.com Customer Care : 8855041500 Career Guidance : 9823205144 Tech Support : 7758806112 Human Resource: 9823204144 You can also Find us on: