Passing pinters to fucntion, referencing

PHOTO EMBED

Mon Feb 12 2024 14:50:46 GMT+0000 (Coordinated Universal Time)

Saved by @sinasina1368 #c++

#include <iostream>


using namespace std;

void increasePrice(double& price) {
    price *= 1.2;

}
int main() {

    double price = 100;
    increasePrice(price);
    cout << price;

    return 0;
}
content_copyCOPY