Std::string Std::wstring Std::basic - String Std::u16string Std::u32string
Std::string Std::wstring Std::basic - String Std::u16string Std::u32string
2. The functions are categorized within different header files. For example, functions
converting from uppercase to lowercase are defined
in boost/algorithm/string/case_conv.hpp.
4. Boost.MinMax provides an algorithm to find the minimum and the maximum of two
values using only one function call, which is more efficient than
calling std::min() and std::max().
5. Boost.MinMax is part of C++11. You find the algorithms from this Boost library in the
header file algorithm if your development environment supports C++11.
6. Coroutines are a feature of other programming languages, which often use the
keyword yield for coroutines
11. Boost.Foreach provides a macro that simulates the range-based for loop from C++11
12. You can use the macro BOOST_FOREACH, defined in boost/foreach.hpp, to iterate
over a sequence without using iterators
14. BOOST_FOREACH expects two parameters. The first parameter is a variable or reference,
and the second is a sequence
15. The Boost.TypeTraits library provides the tools needed to determine a type’s properties
and change them.
16. You can access those functions through the header file type_traits. However,
Boost.TypeTraits provides additional functions.
21. defines the function template create(), which returns an object of the type passed as a
template parameter.
22. Boost.Bind is a library that simplifies and generalizes capabilities that originally
required std::bind1st() and std::bind2nd().
23. If your development environment supports C++11, you will find the
function std::bind() in the header file functional.
24. The third parameter of std::for_each() is a function or function object that expects a
sole parameter.
25. std::for_each() passes the numbers in the container v as sole parameters, one
after another, to print().
26. The library Boost.Ref provides two functions, boost::ref() and boost::cref(), in
the header file boost/ref.hpp. They are useful if you use, for
example, std::bind() for a function which expects parameters by reference.
Because std::bind() takes parameters by value, you have to deal with references
explicitly.
27. Boost.Ref was added to the standard library in C++11, where you will find the
functions std::ref() and std::cref() in the header file functional.
28. The library Boost.Filesystem makes it easy to work with files and directories. It provides a
class called boost::filesystem::path that processes paths.
32. uses the function get_even_random_number(), which should return an even random
number. It does this in a rather naive fashion by calling the function std::rand() from
the standard library. If std::rand() generates an even random number, that number is
returned by get_even_random_number(). If the generated random number is odd, -1
is returned.
1. For debugging with GDB, the file “sanfoundry” can be created with the command
b) gcc -g sanfoundry.c
c) gdb sanfoundry
Answer: a
2. For debugging with GDB, the compiled program can be run by the command
a) run
b) execute
c) ./<filename>
Answer: a
a) break
b) b
Answer: c
a) GNU debugger
c) General debugger
Answer: a
a) c language
b) c++ language
Answer: c
a) will start debugging for the file “sanfoundry” if the file is compiled with -g option with GCC
Answer: a
7. In debugging with GDB, break points can be set to
a) any line
b) any function
Answer: c
a) next
b) continue
Answer: b
Answer: a
10. To print the value of a variable while debugging with GDB, ______ command can be used.
a) printf
b) print
c) show
a) print/x
b) print/h
c) print/e
Answer: a
2. Which GDB command interrupts the program whenever the value of a variable is modified and prints
the value old and new values of the variable?
a) watch
b) show
c) trace
Answer: a
3. Which GDB command produces a stack trace of the function calls that lead to a segmentation fault?
a) trace
b) backtrace
c) forwardtrace
Answer: b
a) delete
b) del
c) remove
Answer: a
c) executes the current line of the program & stops the next statement to be executed
Answer: c
a) file
b) reload
c) debug
Answer: a
Answer: d
8. Which GDB command can be used to put a breakpoint at the beginning of the program?
a) b main
b) b start
c) break
Answer: a
9. To put the breakpoint at the current line ____ command can be used?
a) b
b) break
Answer: c
a) info break
b) break all
Answer: a