C++

posted by .

The variables arr1 and arr2 have been declared as pointers to integers . An array of 10 elements has been allocated, its pointer assigned to arr1, and the elements initialized to some values . Allocate an array of 20 elements , assign its pointer to arr2, copy the 10 elements from arr1 to the first 10 elements of arr2, and initialize the remainder of the elements of arr2 to 0.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Programming

    Here is the source code for the Kitty class: public class Kitty { String name; int age; public Kitty(){ } public void setName(String n){ name = n; } public String getName(){ return name; } public void setAge(int a){ age = a; } public …
  2. computer science C++

    The variables arr1 and arr2 have been declared as pointers to integers. An array of 10 elements has been allocated, its pointer assigned to arr1, and the elements initialized to some values. Allocate an array of 20 elements, assign …
  3. computer science

    int *reverse(const int *, int); int *temp; temp = reverse(arr1,N); int *reverse(const int *arr1, int N) { int *arr2; arr2 = new int[N]; for(int count = 0; count < N; count++) { for(int index = (N-1); index <= 0; index--) arr2[count] …
  4. computer science

    The variable cp_arr has been declared as an array of 26 pointers to char. Allocate 26 character values, initialized to the letters 'A' through 'Z' and assign their pointers to the elements of cp_arr (in that order).
  5. computer science

    The variable cp_arr has been declared as an array of 26 pointers to char. Allocate 26 character values, initialized to the letters 'A' through 'Z' and assign their pointers to the elements of cp_arr (in that order). int *arr1[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; …
  6. computer science

    9.10: Reverse Array Write a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should …
  7. computer science

    Declare a structure whose tag name is Emp and that contains these fields (in the following order): a double field named d, a character pointer named str, and an array of eleven integers named arr. * I'm good till here. In addition, …
  8. computer science

    my code works in c++ so the logical I am getting error must be in the reading of the problem, but I can't see it: Given a type Money that is a structured type with two int fields, dollars and cents. Assume that an array named monthlySales …
  9. computer science

    Assume that BlogComment is a structured type with these fields, comment (a string, the actual comment), and two int fields: like, dislike which count the number of "likes" and "dislikes" of the comment by visitors. Assume that nComments …
  10. assembler language

    write an assembly language subordinate count according to these specs: accepts a pointer to an array or signed words in register X. Accepts a word value in register Y, which indicates the number of array elementsl Returns the number …

More Similar Questions