my simple code not working and it seems Im blind

I found a code like this on the internet and compared it to mine, saw he added & so I did too, but still not working, I tried his and his is working but mine not, help pls

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  #include "pch.h"
#include <iostream>
#include <string>
#include <cmath>
#include <ctime>
#include <cstdlib>
using namespace std;

void jeffko(int x); // Im testing the ability to change values through other functions



void makaroneko(int &x);

void bikko(int *x);// but int is incompatible with int *, I cannot figure out why, this aint it chief

int main()
{

	int jeff = 10;
	int bik = 12;
	int makarone = 13;

	jeffko(jeff);
	makaroneko(makarone);
	bikko(bik);
	


	cout << makarone << endl;
}


void jeffko(int x) {

	x = 500;
}


void makaroneko(int &x) {

	x = 500;
}

void bikko(int *x) {

	*x = 222;
}
closed account (1vRz3TCk)
In main you need to call bikko with the address of bik: bikko(&bik);
well Im stupid, thanks :)
Topic archived. No new replies allowed.