C++
Is <code>s ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Is
std::string
an STL container?
Yes
No
Explanation
It is a standard library class but is not included in STL, despite the fact that it supports many functions for the operations with algorithms, as well as similar methods. Anyway, this is just a typedef for the specialization of the template.
std::string
std
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
Related Content
Дана строка: "std::wstring ws(L"Hello world!!!");". Но функция, которую мы планируем вызвать, объявлена как: "void Print(std::string s);". Каким из следующих преобразований "ws" в "s" необходимо воспользоваться для правильной передачи содержимого "ws" в функцию "Print"?
Что выведет следующий код: struct A { ~A() { std::cout << "~A()"; } }; struct B : A { ~B() { std::cout << "~B()"; } }; struct C : B { ~C() { std::cout << "~C()"; } }; int main() { std::shared_ptr<A> p(false ? new B() : new C()); return 0; }
в каких строках содержатся ошибки? #include <string> using std::string; void test() { string s1 = "foo" "bar"; //1 string s2 = "foo" + "bar"; //2 string s3 = string("foo") + "bar"; //3 string s4 = "foo" + string("bar"); //4 string s5 = 'a'; //5 string s6 = 'a' + 'b'; //6 }
Из перечисленных типов стандартной библиотеки отметьте ассоциативные контейнеры:
Что выведет данная программа на экран: #include <iostream> #include <set> #include <string> int main() { char a[] = "CADEBA"; std::set<char> s(a, a + sizeof(a) - 1); std::cout<<std::string(s.begin(),s.end())<<std::endl; }
C
++
Quiz
Login to learn C++
or
Read more about
C++ Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Keep exploring
C++ quizzes
int main() { const int* i = int(); // 1 int const* j = int(); //2 int* const k = int(); //3 int* l(); //4 ++i; //5 ++j; //6 ++k; //7 ++*k; //8 ++l; //9 } Откомпилируется ли такой код? Если нет, то в каких строчках будут ошибки компиляции? После стандарта C++14.
Какой результат работы программы? #include <iostream> using namespace std; void f(double) { cout<<"f1"<<endl; } void f(const int ) { cout<<"f2"<<endl; } void f( int & ) { cout<<"f3"<<endl; } void main(void) { int n = 1; double b = 2; f(n); f(b); }
#include <iostream> using namespace std; int &test() { static int a = 3; return a; } int main() { ++++++test(); cout << test() << endl; return 0; } Что выведет cout?
При истинности какого из приведенных высказываний имеет смысл вычитание указателей?
Какое ключевое слово используется для описания пространства имен?
В чем разница между X x; и X x(); ?
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment