answersLogoWhite

0

int* a = new int(40);

int* b = new int(2);

int x = *a + *b; // x = 42

delete b;

delete a;

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

How do you declare a string array and add elements to it in C plus plus?

You cannot add elements to a fixed array in C or C++. If, however, the array is declared as a pointer to an array, you can add elements by allocating a new array, copying/adding elements as needed, reassigning the new array to the pointer, and deallocating the original array.


What is 3 plus 3 plus 3 plus 3 plus 4 plus 4 plus 5 plus 9?

it is simple arithmetic. to solve, just add the numbers using the addition property and recieve the answer of 34


How do you add 3 numbers using c plus plus?

int x = 1, y = 2, z = 3; int f = x + y + z;


When using distributive property if you add the numbers is the answer a product or a sum?

If you simply add numbers the answer is the sum of those numbers.


What is these numbers average 29.7 plus 48.9 plus 8?

Just add the numbers, and divide the result by 3 (since there are 3 numbers).


What is 1.05 plus 1.10 plus 1.15 plus 1.20 plus?

The answer is 4.50. Simply add up all of the numbers arithmetically like you would for two plus two. To make sure the answer is correct, check your work using a calculator.


What is 75 plus 75 plus 75 plus what is 75 add 75 add 75?

225 and if you mean both(all the numbers) it is 450


How can you add numbers?

Using the additive property (+).


How do you add more than two numbers in C plus plus?

sum = a + b + c;


How is renaming to add mixed numbers different from regrouping to add whole numbers?

7 7/12 plus 3 8/9


How do you get the sum of two numbers?

The best method is to add the numbers, using arithmetic.


What is 12 plus 5 plus 7 plus 4 plus 12 plus 5 plus 17 plus 14?

The answer is 76. Simply add up all of the numbers arithmetically like you would for two plus two. To make sure the answer is correct, check your work using a calculator.