C++ questions: urgent, please help me answer all of the following questions, thu
ID: 3918235 • Letter: C
Question
C++ questions:
urgent, please help me answer all of the following questions, thumb up for all correct answers.
thanks!
What will be the output of the following C++ code:
int main()
{
int a = 6;
int b = 5;
int c = 10;
int *aptr = &a;
int *bptr = &b;
int *cptr = &c;
cout << "Value of a: " << a << endl;
cout << "Value of b: " << *bptr << endl;
cout << "Value of c: " << c << endl;
*aptr = *aptr + *cptr;
c = c - *bptr;
cout << "Value of a: " << a << endl;
cout << "Value of b: " << b << endl;
cout << "Value of c: " << *cptr << endl;
return 0;
}
Value of a: 6
Value of b: 5
Value of c: 10
Value of a: 16
Value of b: 5
Value of c: 6
Value of a: 5
Value of b: 6
Value of c: 10
Value of a: 16
Value of b: 5
Value of c: 5
Value of a: 6
Value of b: 5
Value of c: 16
Value of a: 10
Value of b: 5
Value of c: 5
Value of a: 6
Value of b: 5
Value of c: 10
Value of a: 16
Value of b: 5
Value of c: 5
Value of a: 6
Value of b: 5
Value of c: 10
Value of a: 16
Value of b: 5
Value of c: 6
Question 19 2 pts If fobj is a object of type fstream, then the following statement fobj.seekp(32L, ios:beg); sets the write position to the 33rd byte (byte 32) from the beginning of the file sets the write position to the 32rd byte (byte 31) from the beginning of the file It works differently with different operating systems You cannot tell from the information givenExplanation / Answer
19. a) set the write position to 33rd byte from the beginning of the file.
Explanation:
seekp() is used to move the put pointer to a desired location with respect to a reference point.
Syntax: file_pointer.seekp(number of bytes ,Reference point);
20. d) sets the write pos to the 121st byte from the current position.
Explanation:
seekp() is used to move the put pointer to a desired location with respect to a reference point.
Syntax: file_pointer.seekp(number of bytes ,Reference point);
18. e) A,B and C statements are correct.
Explanation: Self explanatory.
17. D) A and B statements are correct.
Explanation: Self explanatory.
16.
Explanation: Self explanatory.
36. a) 001101
Explanation: Self explanatory.
37. c) ShuffleFlapFlapFlapFlap
Explanation: Self explanatory.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.