forked from Akatakata/zerda-exam-cpp-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03.cpp
More file actions
33 lines (28 loc) · 759 Bytes
/
Copy path03.cpp
File metadata and controls
33 lines (28 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
using namespace std;
void multiplyvalue(float* pointer, float num) {
float* sum;
*sum = *pointer * num;
cout << "The final value: " << *sum << endl;
cout << "Address of the final value: " << pointer << endl;
}
/*void multiplyvalue2(float* pointer, float num) {
float sum;
sum = *pointer * num;
cout << sum << endl;
float* sumpointer = ∑
cout << sumpointer;
}
*/
/**
* Create a function that takes a pointer to a float and a float, then it should
* multiply the value of the pointer with the given float and save the result
* where the pointer points.
* Please mutliply the total variable by 5 with it.
*/
int main() {
float total = 123;
float number = 5;
multiplyvalue (&total, number);
return 0;
}