MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors in C++ Programming
→
How many parameters are available in the function ..
1.
How many parameters are available in the function setbuf?
A.
4
B.
3
C.
2
D.
1
E.
None of these
Answer» D. 1
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> int main ()<br> {<br> FILE * ptr;<br> long size;<br> ptr = fopen ("Example.txt", "rb");<br> if (ptr == NULL) <br> perror ("Error opening file");<br> else<br> {<br> fseek (ptr, 0, SEEK_END); <br> size = ftell (ptr);<br> fclose (ptr);<br> printf (" %ld n", size);<br> }<br> return 0;<br> }<br></pre>
By seeing which operator thus this program stops getting the input?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <fstream><br> using namespace std;<br> int main ()<br> {<br> char ch;<br> streambuf * pbuf;<br> ofstream os ("Example.txt");<br> pbuf = os.rdbuf();<br> do {<br> ch = cin.get();<br> pbuf -> sputc(ch);<br> } while (ch != '.');<br> os.close();<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int main ()<br> {<br> char First_ch, Second_ch, Third_ch;<br> cout << "Enter any word or number: ";<br> First_ch = cin.get();<br> cin.sync();<br> Second_ch = cin.get();<br> cin.sync();<br> Third_ch = cin.get();<br> cout << First_ch << endl;<br> cout << Second_ch << endl;<br> cout << Third_ch << endl;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <fstream><br> using namespace std;<br> int main () <br> {<br> int len;<br> char * buff;<br> ifstream is;<br> is.open ("Example.txt", ios :: binary );<br> is.seekg (0, ios :: end);<br> len = is.tellg();<br> is.seekg (0, ios :: beg);<br> buff = new char [len];<br> is.read (buff, len);<br> is.close();<br> cout.write (buff, len);<br> delete[] buff;<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int main ()<br> {<br> int num1 = 150;<br> double num2 = 6.251;<br> cout << num1;<br> cout << " ";<br> cout << num2 << " " << num1 * num2;<br> endl (cout);<br> return 0;<br> }<br></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <fstream><br> using namespace std;<br> int main () <br> {<br> ofstream outfile ("Sample.txt");<br> for (int num = 0; num < 50; num++)<br> {<br> outfile << num;<br> outfile.flush();<br> }<br> cout << "Done successfully";<br> outfile.close();<br> return 0;<br> }<br></pre>
What is the output of this program in text files?<br><pre class="prettyprint lang-c">#include <iostream><br> int main ()<br> {<br> char buff[BUFSIZ];<br> FILE *ptr1, *ptr2;<br> ptr1 = fopen ("FirstFile.txt", "w");<br> ptr2 = fopen ("SecondFile.txt", "a");<br> setbuf ( ptr1 , buff );<br> fputs ("Buffered stream", ptr1);<br> fflush (ptr1);<br> setbuf ( ptr2 , NULL );<br> fputs ("Unbuffered stream", ptr2);<br> fclose (ptr1);<br> fclose (ptr2);<br> return 0;<br> }<br></pre>
What is the output of this program in the text file?<br><pre class="prettyprint lang-c">#include <stdio.h><br> int main ()<br> {<br> FILE * ptr;<br> char buff[] = { 'I' , 'L' , 'U' };<br> ptr = fopen ( "Example.txt" , "wb" );<br> fwrite (buff , 1 , sizeof(buff) , ptr );<br> fclose (ptr);<br> return 0;<br> }<br></stdio.h></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> int main ()<br> {<br> int k;<br> FILE * ptr;<br> char buff[10];<br> ptr = fopen ("Sample.txt", "w+");<br> for ( k = 'A' ; k <= 'D' ; k++)<br> fputc ( k, ptr);<br> rewind (ptr);<br> fread (buff, 1, 5, ptr);<br> fclose (ptr);<br> buff[3] = ' 0';<br> puts (buff);<br> return 0;<br> }<br></pre>
What is the output of this program in the file?<br><pre class="prettyprint lang-c">#include <iostream><br> int main ()<br> {<br> freopen ("Sample.txt", "w", stdout);<br> printf ("This is redirected to a file");<br> fclose (stdout);<br> return 0;<br> }<br></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply