ASDV-WebDev/Semester 3/Assignments/functions/main.cpp

53 lines
1.0 KiB
C++

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

/*
* 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: main.cpp
* Author: caleb
*
* Created on March 1, 2024, 10:06AM
*/
#include <cstdlib>
#include <iostream>
using namespace std;
#include "functions.h"
#include "arrays.h"
/*
*
*/
int main(int argc, char** argv) {
f1();
int y = 10;
passByReference(y);
cout << y << endl;
staticVarFunction();
staticVarFunction();
staticVarFunction();
cout << returnReference(y) << endl;
cout << y << endl;
int arr1[3] = {1, 2 ,3};
initializeArray (arr1, 3);
printArray(arr1, 3);
int& rAr = returnAddressOfFirstElementOfArray(arr1);
cout << endl;
cout << rAr << " " << &rAr << " " << endl;
int arr2[2][3] = {
{1, 2 ,3},
{-1, -9, -4}
};
int min = 0;
cout << "max: " << findMaxAndMin(arr2, min) << endl;
cout << "min: " << endl;
return 0;
}