Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password

Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.

Question

A symbol used to access the value of an address
click to flip
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't know

Question

When does the void pointer can be dereferenced?
Remaining cards (47)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

CCS0007 Pointers

QuestionAnswer
A symbol used to access the value of an address *
When does the void pointer can be dereferenced? When it cast to another type of object
What is the output of this program? #include < iostream > using namespace std; int main() { char *ptr; char Str[] = "abcdefg"; ptr = Str; ptr += 5; cout << ptr; return 0; } fg
Which of the following is a reference operator? &
What is the output of the following? #include <iostream> using namespace std; int main() { int var = 40; int *ip; ip = &var; cout << *ip << endl; //cout << ""40""; return 0; }" 40
What is the output of the following? #include <iostream> using namespace std; int main() { int var = 20; int *ip; ip = &var; cout << *ip << endl; return 0; } 20
Which of the following is NOT true about static arrays? Memory space is allocated at runtime
Which of the following is NOT true about dynamic arrays? Memory space is allocated during compile time
Dynamically allocated memory is allocated on ___________________ Heap
#include <iostream> using namespace std; int main() { int * foo = new int [5]; foo[0] = 8; cout << foo [0]; delete[] foo; return 0; } 8
A symbol used to determine the address of a variable &
What is the output of the following program? #include <iostream> using namespace std; int main() { string food = ""Pizza""; string * ptr = &food; cout << food << "" ""; cout << *ptr << ""\n""; } Pizza Pizza
Which of the following is NOT a way to declare a pointer variable? string mystring *;
#include <iostream> using namespace std; int main() { string food = ""Pizza""; string* ptr = &food; cout << food << ""\n""; return 0; } Pizza
It is a pointer not associated with any data types void pointer
What operator is used to free allocated memory? delete operator
What is the output of the program? #include <iostream> using namespace std; int main() { int *ptr = new int; int a = 143; ptr = &a; cout << *ptr << endl; return 0; } 143
#include <iostream> using namespace std; int main() { int *ptr = new int; int a = 143; ptr = &a; cout << ptr << endl; return 0; } A memory address
Denotes a request for memory allocation on the Free Store new operator
"What is the output of the following? #include <iostream> using namespace std; int main() { int * foo; foo = new int [5]; foo[0] = 1; foo[1] = 2; foo[2] = 3; foo[3] = 4; foo[4] = 5; for (int 1 2 3 4 5
"What is the output of the following program? #include <iostream> using namespace std; int main() { int n; n = 3; int * p = new int[n]; for (int i = 0; i<n;i++) { p[n] = 10; cout << p[n] << 10 10 10
Complete the given code: #include <iostream> using namespace std; int main() { int var1 = 17; cout << ________ << endl; return 0; } var1
It stores the memory address as its value. Pointer
What is the declaration for the pointer that points to a variable of type int? int *p;
Which of the following is NOT true about static arrays? Memory space is allocated at runtime
How a static array is declared? float a [10];
Which of the following is NOT true about dynamic arrays? Memory space is allocated during compile time
What is used for accessing the contents of memory location whose address is stored in a pointer variable? By applying the dereference operator
Dynamically allocated memory is allocated on ___________________ Heap
#include <iostream> using namespace std; int main() { int * foo = new int [5]; foo[0] = 8; cout << foo [0]; delete[] foo; return 0; } 8
A symbol used to determine the address of a variable &
What is the output of the following program? #include <iostream> using namespace std; int main() { string food = ""Pizza""; string * ptr = &food; cout << food << "" ""; cout << *ptr << ""\n""; } Pizza Pizza
Which of the following is NOT a way to declare a pointer variable? string mystring *;
#include <iostream> using namespace std; int main() { string food = ""Pizza""; string* ptr = &food; cout << food << ""\n""; return 0; } Pizza
It is a pointer not associated with any data types void pointer
What operator is used to free allocated memory? delete operator
#include <iostream> using namespace std; int main() { int *ptr = new int; int a = 143; ptr = &a; cout << ptr << endl; return 0; } A memory address
Denotes a request for memory allocation on the Free Store new operator
#include <iostream> using namespace std; int main() { int n; n = 3; int * p = new int[n]; for (int i = 0; i<n;i++) { p[n] = 10; cout << p[n] << "" ""; } delete []p; return 0; } 10 10 10
0x7fffe867d790 is an example of: Memory Address
What will happen in this code? int a = 100, b = 200; int *p = &a, *q = &b; p = q; p now points to b
What is the output of the following? #include <iostream> using namespace std; int main() { int var = 11; int *ip, *ip2; ip = &var; ip2 = ip; cout << *ip << "" "" << *ip2; return 0; } 11 11
#include <iostream> using namespace std; int main() { int * foo; foo = new int [5]; foo[0] = 1; foo[1] = 2; foo[2] = 3; foo[3] = 4; foo[4] = 5 delete[] foo; cout ; return 0; } Error
#include <iostream> using namespace std; int main() { int *p1 = new int(); int *p2 = new int(); int *p3 = new int(); *p1 = 45; p2 = p1; *p3 = *p1+*p2; cout << *p3 << endl; return 0; } 90
Choose the right option: string* x, y; x is a pointer to a string, y is a string
double * p = new double [45]; is an example of: Dynamic array declaration
A void pointer can point to which type of objects? all of the mentioned(any data type)
To create a dynamic array, you have to use: all of the given (pointer,array,new operator)
Created by: xhinvier
 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards