Using the code below as a reference, select all options that are true below. You can run q copy the program and add cout << "variable: " << sizeof (variable) << endl; statements to verify the cor answers below. #include using namespace std; int main () { int a=10; // the size of a is // the size of d is // the size of c is // the size of p is // the value of p is // the size of q is // the value of q is // the size of t is // the value of t is // the value of p is // the value of q is // the value of t is // displays // the following // displays // the following // displays // the following cout << "p+1=" << p+1 << endl; // How much p differs from p+1? cout << "g+1=" << g+1 « endl; // How much g differs from q+1? cout << "t+1=" << t+1 <« endl; // How much t differs from t+1? double d=3.1415; char c='A'; int * p = nullptr; double + q=NULL; char * t=nullptr; p = Ga; q = sd; t = &c; cout << *p « endl; When accessing *p, bytes are accessed. When accessing *g, cout << * g « endl; bytes are accessed. cout << *t <« endl; When accessing *t, bytes are accessed. return 0; O sizeof(a) == 1 O sizeof(a) == 4 O sizeof(a) == 8 O sizeof(d) == 1 O sizeof(d) == 4 O sizeof(d) == 8 O sizeof(c) =- 1 O sizeof(c) == 4 O sizeof(c) == 8 O sizeof(p) == 4 && sizeof(q) == 8 && sizeof(t) == 1 O sizeof(p) == 8 && sizeof(q) == 8 && sizeof(t) == 8 p+1 differs by 1 byte O p+1 differs by 4 bytes O p+1 differs by 8 bytes O g+1 differs by 1 byte O q+1 differs by 4 bytes O q+1 differs by 8 bytes

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Using the code below as a reference, select all options that are true below. You can run q copy the program and add cout << "variable: " << sizeof (variable) << endl; statements to verify the cor
answers below.
#include <iostream>
using namespace std;
int main () {
int a=10;
// the size of a is
// the size of d is
// the size of c is
// the size of p is
// the value of p is
// the size of q is
// the value of q is
// the size of t is
// the value of t is
// the value of p is
// the value of q is
// the value of t is
// displays
// the following
// displays
// the following
// displays
// the following
cout << "p+1=" << p+1 << endl; // How much p differs from p+1?
cout << "g+1=" << g+1 « endl; // How much g differs from q+1?
cout << "t+1=" << t+1 <« endl; // How much t differs from t+1?
double d=3.1415;
char c='A';
int * p = nullptr;
double + q=NULL;
char * t=nullptr;
p = Ga;
q = sd;
t = &c;
cout << *p « endl;
When accessing *p,
bytes are accessed.
When accessing *g,
cout << * g « endl;
bytes are accessed.
cout << *t <« endl;
When accessing *t,
bytes
are accessed.
return 0;
O sizeof(a) == 1
O sizeof(a) == 4
O sizeof(a) == 8
O sizeof(d) == 1
O sizeof(d) == 4
O sizeof(d) == 8
O sizeof(c) =- 1
O sizeof(c) == 4
O sizeof(c) == 8
O sizeof(p) == 4 && sizeof(q) == 8 && sizeof(t) == 1
O sizeof(p) == 8 && sizeof(q) == 8 && sizeof(t) == 8
p+1 differs by 1 byte
O p+1 differs by 4 bytes
O p+1 differs by 8 bytes
O g+1 differs by 1 byte
O q+1 differs by 4 bytes
O q+1 differs by 8 bytes
Transcribed Image Text:Using the code below as a reference, select all options that are true below. You can run q copy the program and add cout << "variable: " << sizeof (variable) << endl; statements to verify the cor answers below. #include <iostream> using namespace std; int main () { int a=10; // the size of a is // the size of d is // the size of c is // the size of p is // the value of p is // the size of q is // the value of q is // the size of t is // the value of t is // the value of p is // the value of q is // the value of t is // displays // the following // displays // the following // displays // the following cout << "p+1=" << p+1 << endl; // How much p differs from p+1? cout << "g+1=" << g+1 « endl; // How much g differs from q+1? cout << "t+1=" << t+1 <« endl; // How much t differs from t+1? double d=3.1415; char c='A'; int * p = nullptr; double + q=NULL; char * t=nullptr; p = Ga; q = sd; t = &c; cout << *p « endl; When accessing *p, bytes are accessed. When accessing *g, cout << * g « endl; bytes are accessed. cout << *t <« endl; When accessing *t, bytes are accessed. return 0; O sizeof(a) == 1 O sizeof(a) == 4 O sizeof(a) == 8 O sizeof(d) == 1 O sizeof(d) == 4 O sizeof(d) == 8 O sizeof(c) =- 1 O sizeof(c) == 4 O sizeof(c) == 8 O sizeof(p) == 4 && sizeof(q) == 8 && sizeof(t) == 1 O sizeof(p) == 8 && sizeof(q) == 8 && sizeof(t) == 8 p+1 differs by 1 byte O p+1 differs by 4 bytes O p+1 differs by 8 bytes O g+1 differs by 1 byte O q+1 differs by 4 bytes O q+1 differs by 8 bytes
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY