c++ quirks
Posted: 04 Jul 2011, 20:22
What is the difference between the following code segments?
---
Under what circumstances is if valid to say
? Under what circumstances would it be useful? Why wouldn't it be? What are the alternatives?
---
When is it possible to initialize an enum (even a C++0x strict enum!) to a value not contained in the enum?
---
During what parts of a function can you declare variables?
---
What is the main ability of C switch statements that is not in Java?
---
When is the empty statement needed? What are the clearer alternatives?
---
What is the major shortcoming of std::min and std::max?
---
What is the significance of returning a const object by value?
Code: Select all
try {
whatever;
} catch(Foo& foo) {
throw;
}
Code: Select all
try {
whatever;
} catch(Foo& foo) {
throw foo;
}
Under what circumstances is if valid to say
Code: Select all
Foo<std::vector>
---
When is it possible to initialize an enum (even a C++0x strict enum!) to a value not contained in the enum?
---
During what parts of a function can you declare variables?
---
What is the main ability of C switch statements that is not in Java?
---
When is the empty statement needed? What are the clearer alternatives?
---
What is the major shortcoming of std::min and std::max?
---
What is the significance of returning a const object by value?