Question

Assume that integer array b[5] and integer pointer variable bPtr have been defined. Write a statement...

Assume that integer array b[5] and integer pointer variable bPtr have been defined. Write a statement to set bPtr equal to the address of the first element in array b. Write a statement using pointer expression to reference the array element b[3].

please make sure answer should be detailed ,  correct and in C language.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Answer:
statement to set bPtr equal to the address of the first element in array is 
bPtr = &b;

statement using pointer expression to reference the array element b[3] is
*(bPtr + 3)
Add a comment
Know the answer?
Add Answer to:
Assume that integer array b[5] and integer pointer variable bPtr have been defined. Write a statement...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • the coding language is in c++ An array named testScores has already been declared. -size= 5...

    the coding language is in c++ An array named testScores has already been declared. -size= 5 -data type = float - the array has already been initialized these values: 77, 88.5, 90, 93, 71.5 -Write one statement to declare a pointer named: ptr - in the same statement, assign the address to the testScores array to the pointer -write one statement to output the memory address of the array element at testScores[0] -Write a for loop to output the values...

  • please answer all the questions. 2. (35 pts, 5 each) Consider the following array a. Write...

    please answer all the questions. 2. (35 pts, 5 each) Consider the following array a. Write single-line statements to do the following double a[8] {0.0, = 10.0, 20.0, 30.0, 40.0), *p , ,g: Set the pointer p to point to the first element of the array - I ?-K-U) Set pointer q to point to the element with value 20.0 in the array as afn] with the correct n value. Use p above to triple the value stored in a[1]...

  • Assume the existence of a class Arr with two (public) data members: a pointer to integer...

    Assume the existence of a class Arr with two (public) data members: a pointer to integer named arr_ptr, and an integer variable namedlength that will contain the number of elements in the array. Assume the variable a has been declared to be of type Arr, an array has been allocated and assigned to arr_ptr, and length has been assigned the proper value (i.e., the number of elements in the array). Write the code to add 1 to each element of...

  • B. Which statement would be used to define a to element integer array c? a. Array...

    B. Which statement would be used to define a to element integer array c? a. Array c = int[10]; b. C = int[10]; c. int Array c[10]; d. int c[10]; 17. Declare an Integer pointer variable named int_ptr. 18. Use the pointer created in question 17 and assign it the memory location of a variable named int_var. 19. Suppose you have an executable program named count that counts the characters in its input. Devise a command-line command using the count...

  • a) (C language) Let’s consider an integer array of size 10. (10 marks, each part is...

    a) (C language) Let’s consider an integer array of size 10. (10 marks, each part is 2 marks) int a[10]; I. How would you assign a pointer, called pA, to store the address of element 0 of this array? Write the C code for your answer. II. Using pA, how would you obtain the value of the next element (element 1) of the array? III. Explain in 2-3 sentences what the statement pA = a[1]; would do. IV. Is the...

  • TRUE/FALSE 1. If pl is an integer pointer variable, with the value of 1000, pl++ changes...

    TRUE/FALSE 1. If pl is an integer pointer variable, with the value of 1000, pl++ changes P1 to point to the memory location 1001. ANSWER: T 2. When you return a dynamic array to the freestore, you must include the number of elements in the array 3. You can assign an array to a pointer variable. 4. The size of dynamic arrays must be declared at compile time. 5. int *pl; declares a static variable. ANSWER: F ANSWER: F ANSWER:...

  • Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory...

    Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int * ) named ptr_1. Use ptr_1 to assign the number 7 to that dynamically allocated integer, and in another line use printf to output the contents of that dynamically allocated integer variable. Write the code to dynamically allocate an integer array of length 5 using calloc or malloc and have it pointed...

  • C# 1.) Assume an integer array named bArray was dimensioned to store 10 rows and 2...

    C# 1.) Assume an integer array named bArray was dimensioned to store 10 rows and 2 columns. Use a variable named element to reference individual cells. Fill in the blanks below for the foreach loop which might be used to display the contents of the array. foreach(Blank 1, Blank 2, Blank 3, Blank 4) . 2.) In order to place a new element in an ArrayList use the ___________ method. 3.) With the following declaration: int [ , ] ctn...

  • using visual studio 2) For each of the following, write C++ statements that perform the specified...

    using visual studio 2) For each of the following, write C++ statements that perform the specified task.. (Ref: classwork named pointer2) a) Declare a built-in array of type unsigned int called values with five elements, and initialize the elements to the even integers from 2 to 10. b) Declare a pointer vPtr that points to a variable of type unsigned int. c) Write two separate statements that assign the starting address of array values to pointer variable vPtr. d) Use...

  • Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is...

    Help fast :Assume a variable called orange exists of type Fruit pointer. The Fruit structure is defined below. For the variable orange, write a statement that assigns a member variable named hasSeeds to 1 typedef struct Fruit struct f a. &(orange.hasSeeds) 1; b. orange.("hasSeeds) 1 c. orange->hasSeeds 1; d. orange.hasSeeds 1; // menber variables Fruit; Q8: When the malloc function is called, the malloc function returns a(n) a. address on the heap b. address on the stack c. address on...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT