What is a void return type? »
| 0 Comments |
A void return type indicates that a method does not return a value.
Java Interview Questions | IT interview questions | Software Testing Interview questions | .Net Interview Questions | Job Interview Questions & Answers | Tough Interview Questions | Technology Interview Questions | Tech Interview Questions | Testing Interview Questions | SAP Interview Questions | ABAP Interview Questions | Data Warehousing Interview Questions
Category: C/C++ Interview Questions| 0 Comments |
A void return type indicates that a method does not return a value.
| 0 Comments |
The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.
| 0 Comments |
A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.
| 0 Comments |
Yes, a for statement can loop indefinitely. For example, consider the following:
for(;;) ;
| 0 Comments |
void reverselist(void)
{
if(head==0)
return;
if(head->next==0)
return;
if(head->next==tail)
{
head->next = 0;
tail->next = head;
}
else
{
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur->next = head;
for(; curnext!=0; )
{
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;
}
curnext->next = cur;
}
}
| 0 Comments |
No. It is specified in the definition of the copy constructor itself. It should generate an error if a programmer specifies a copy constructor with a first argument that is an object and not a reference.
| 0 Comments |
Local class is a class defined within the scope of a function — any function, whether a member function or a free function. For example:
// Example 2: Local class
//
int f()
{
class LocalClass
{
// …
};
// …
};
Like nested classes, local classes can be a useful tool for managing code dependencies.
| 0 Comments |
A nested class is a class enclosed within the scope of another class. For example:
// Example 1: Nested class
//
class OuterClass
{
class NestedClass
{
// …
};
// …
};
Nested classes are useful for organizing code and controlling access and dependencies. Nested classes obey access rules just like other parts of a class do; so, in Example 1, if Nested Class is [...]