Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void by_value(int a){
- a = 77;
- }
- void by_address(int *c){
- *c=99;
- }
- void by_reference(int &b){
- b=88;
- }
- struct clovek{
- int age=0;
- string name="/";
- };
- int main(){
- ofstream file1;
- file1.open("234.txt");
- file1 << "Seos";
- int st=5;
- int* ptr=&st;
- cout << ptr << endl;
- int miran=5;
- int joze=10;
- int franc=15;
- by_value(miran);
- by_address(&joze);
- by_reference(franc);
- cout << "VALUE: " << miran << endl;
- cout << "ADDRESS: " << joze << endl;
- cout << "REFERENCE: " << franc << endl;
- clovek cl1;
- cl1.age=10;
- cout << cl1.age << endl;
- cout << "ime: " << endl;
- getline(cin,cl1.name);
- cout << "Vase ime je "<< cl1.name << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement