Skip to content
Snippets Groups Projects
Commit ecc67536 authored by bmmazzet's avatar bmmazzet
Browse files

Publish exercise 7

parent ae079cc6
No related branches found
No related tags found
No related merge requests found
File added
#include "Dummy.h"
#include <iostream>
/*
void dummyTest() {
Dummy a;
*a.num = 4;
Dummy b{a};
Dummy c;
c = a;
std::cout << "a: " << *a.num << '\n';
std::cout << "b: " << *b.num << '\n';
std::cout << "c: " << *c.num << '\n';
*b.num = 3;
*c.num = 5;
std::cout << "a: " << *a.num << '\n';
std::cout << "b: " << *b.num << '\n';
std::cout << "c: " << *c.num << '\n';
}
*/
\ No newline at end of file
#pragma once
#include <utility>
/*
class Dummy {
public:
int *num;
Dummy() {
num = new int{0};
}
// BEGIN: 3c
// END: 3c
// Copy-Swap: Tar inn rhs som kopi, bytter medlemsvariable
// BEGIN: 3d
// END: 3d
~Dummy() {
delete num;
}
};
void dummyTest();
*/
\ No newline at end of file
#include <cassert>
#include <iostream>
#include "DynamicMemory.h"
// BEGIN: 1a
// END: 1a
// BEGIN: 1b
// END: 1b
// BEGIN: 1c
// END: 1c
\ No newline at end of file
#pragma once
void fillInFibonacciNumbers(int* result, int length);
void printArray(int* array, int length);
void createFibonacci();
\ No newline at end of file
#include "Matrix.h"
// BEGIN: 2b
// END: 2b
// BEGIN: 2c
// END: 2c
// Her kan du gjøre 2d (frivillig):
// BEGIN: 2f
// END: 2f
// BEGIN: 4a
// END: 4a
// BEGIN: 4b
// END: 4b
// BEGIN: 5a
// END: 5a
// BEGIN: 5b
// END: 5b
void testMatrix() {
// Her kan du teste løsningen din (oppgave 5c):
}
// Her kan du gjøre 5d (frivillig):
\ No newline at end of file
#pragma once
#include <iostream>
#include <utility>
class Matrix {
private:
// BEGIN: 2a
// END: 2a
public:
// BEGIN: 2b
// END: 2b
// BEGIN: 2c
// END: 2c
// Her kan du gjøre 2d (frivillig):
// BEGIN: 2e
// END: 2e
// BEGIN: 4a
// END: 4a
// BEGIN: 4b
// END: 4b
// BEGIN: 5a
// END: 5a
// BEGIN: 5b
// END: 5b
// Her kan du gjøre 5d (frivillig):
};
// BEGIN: 2f
// END: 2f
void testMatrix();
#include <iostream>
#include "DynamicMemory.h"
#include "Matrix.h"
#include "Dummy.h"
int main() {
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment