idk
This commit is contained in:
parent
d1ba83064a
commit
49166965ff
7
Makefile
7
Makefile
@ -1,4 +1,4 @@
|
||||
CC := clang++ -Wall -std=c++17 -Wall -Wextra -O1 -g -fsanitize=address,undefined -fno-omit-frame-pointer
|
||||
CC := clang++ -Wall -std=c++17 -Wall -Wextra -g -fsanitize=address,undefined -fno-omit-frame-pointer
|
||||
|
||||
setup:
|
||||
mkdir build
|
||||
@ -34,6 +34,11 @@ sheet05:
|
||||
chmod +x build/sheet05
|
||||
build/sheet05
|
||||
|
||||
sheet06:
|
||||
$(CC) src/sheet06.cpp -o build/sheet06
|
||||
chmod +x build/sheet06
|
||||
build/sheet06
|
||||
|
||||
pizza:
|
||||
$(CC) src/pizza.cpp -o build/pizza
|
||||
chmod +x build/pizza
|
||||
|
@ -211,7 +211,7 @@ class vec
|
||||
int main()
|
||||
{
|
||||
std::string ans;
|
||||
std::cout << "y for vector exercies: ";
|
||||
std::cout << "y for vector exercises: ";
|
||||
std::cin >> ans;
|
||||
if(ans == "y")
|
||||
{
|
||||
|
@ -126,25 +126,19 @@ struct Node {
|
||||
|
||||
void addElement(Node **head, int data)
|
||||
{
|
||||
if(*head == nullptr)
|
||||
{
|
||||
*head = new Node(data);
|
||||
return;
|
||||
}
|
||||
Node **og_head = head;
|
||||
|
||||
Node **next = &(**head).next;
|
||||
do
|
||||
while(*head != nullptr)
|
||||
{
|
||||
*next = (**next).next;
|
||||
head = &(**head).next;
|
||||
}
|
||||
while(*next != nullptr)
|
||||
*next = new Node(data);
|
||||
*head = new Node(data);
|
||||
head = og_head;
|
||||
}
|
||||
void printList(const Node *head)
|
||||
{
|
||||
std::cout << *head << '\n';
|
||||
Node *next = (*head).next;
|
||||
std::cout << (next != nullptr) << '\n';
|
||||
while(next != nullptr)
|
||||
{
|
||||
std::cout << *next << '\n';
|
||||
|
10
src/sheet06.cpp
Normal file
10
src/sheet06.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include<iostream>
|
||||
#define MY_ASSERT(BOOL_EXPR, MESSAGE)
|
||||
{
|
||||
if (!BOOL_EXPR)
|
||||
{
|
||||
std::cout << MESSAGE << '\n';
|
||||
std::cout << __FILE__ << '\n';
|
||||
std::cout << __LINE__ << '\n'
|
||||
}
|
||||
}
|
BIN
vgcore.13380
Normal file
BIN
vgcore.13380
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user