It works but the output is broken :)

This commit is contained in:
2024-03-21 17:08:36 -05:00
parent 39b0da17b9
commit 118d95a69d
219 changed files with 7927 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/main.cc to edit this template
*/
/*
* File: functions.cpp
* Author: caleb
*
* Created on March 1, 2024, 10:07AM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
#include "functions.h"
int global = 0;
void f1() {
cout << "f1()" << endl;
global++;
f2();
}
void f2() {
cout << "f2()" << endl;
global++;
}
void passByReference(int& x) {
global++;
x = 100;
}
void staticVarFunction() {
static int staticInt = 10;
staticInt++;
cout << staticInt << endl;
}
int& returnReference (int & x) {
x++;
return x;
}