MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors in C++ Programming
→
Which operator is used to allocate the memory?..
1.
Which operator is used to allocate the memory?
A.
free
B.
=
C.
+
D.
new
E.
None of these
Answer» E. None of these
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <new><br> using namespace std;<br> struct N <br> {<br> virtual ~N() { };<br> void operator delete(void* ptr1) <br> {<br> cout << "N :: operator delete" << endl;<br> }<br> };<br> struct M : N <br> {<br> void operator delete(void* ptr1) <br> {<br> cout << "M :: operator delete" << endl;<br> }<br> };<br> int main() <br> {<br> N* ptr2 = new M;<br> delete ptr2;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include &ltiostream><br> #include <memory><br> #include <string><br> using namespace std;<br> int main () <br> {<br> pair <string*, ptrdiff_t> Res = get_temporary_buffer<string>(5);<br> if (Res.second > 0)<br> {<br> uninitialized_fill ( Res.first, Res.first + Res.second, <br> "Bye " );<br> for (int k = 0; k < Res.second; k++)<br> cout << Res.first[k] ;<br> return_temporary_buffer(Res.first);<br> }<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <memory><br> #include <string><br> using namespace std;<br> int main ()<br> {<br> string str[] = {"Interveiw", "Mania"};<br> pair <string*, ptrdiff_t> Res = get_temporary_buffer<string>(2);<br> if (Res.second>0) <br> {<br> uninitialized_copy ( str, str + Res.second, Res.first );<br> for (int k = 0; k < Res.second; k++)<br> cout << Res.first[k] << " ";<br> return_temporary_buffer(Res.first);<br> }<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <memory><br> #include <algorithm><br> using namespace std;<br> int main ()<br> {<br> int num[] = {11, 15, 14, 15, 14, 11};<br> pair <int*, ptrdiff_t> Res = get_temporary_buffer<int>(6);<br> if (Res.second > 0)<br> {<br> uninitialized_copy (num, num + Res.second, Res.first);<br> sort (Res.first, Res.first + Res.second);<br> for (int k = 0; k < Res.second; k++)<br> cout << Res.first[k] << " ";<br> return_temporary_buffer (Res.first);<br> }<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <new><br> #include <cstdlib><br> using namespace std;<br> const int bsize = 128;<br> int *ptr1;<br> bool allocate = true;<br> void get_memory() <br> {<br> cerr << "free store exhausted" << endl;<br> delete [] ptr1;<br> allocate = false;<br> }<br> void eat_memory(int size) <br> {<br> int *ptr2 = new int[size];<br> if (allocate)<br> eat_memory(size);<br> else<br> cerr << "free store addr = " << ptr2 << endl;<br> }<br> int main()<br> {<br> set_new_handler(get_memory);<br> ptr1 = new int[bsize];<br> cerr << "free store addr = " << ptr1 << endl;<br> eat_memory(bsize);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream> <br> #include <ctype.h><br> int main ()<br> {<br> int k = 0;<br> char str[] = "Ajit Kumar Gupta";<br> char ch;<br> while (str[k])<br> {<br> ch = str[k];<br> if (islower(ch)) <br> ch = toupper(ch);<br> putchar (ch);<br> k++;<br> }<br> return 0;<br> }<br></pre>
What will the monetary facet will do?
What kind of locale does every program is having in C++?
What is the main feature of locale in C++?
What is the correct syntax for declaring an allocator?
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply