3.5kg fruit, ~50:50 elderberries and blackberries.
2.1kg sugar
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang. | |
CFLAGS = -g -Wall -fanalyzer $(shell pkg-config --cflags openssl) | |
LIBS=$(shell pkg-config --libs openssl) | |
LDFLAGS = $(LIBS) | |
bins = decrypt_file encrypt_file | |
all: $(bins) | |
clean: | |
@for file in $(bins); do \ |
# Another simple make example. Creates 2 bins which include the same c file. | |
# Assumes e.g. you have main.c, main2.c, mylib.c and mylib.h. | |
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang. | |
CFLAGS = -g -Wall -fanalyzer # $(shell pkg-config --cflags openssl) | |
# LIBS=$(shell pkg-config --libs openssl) | |
# LDFLAGS = $(LIBS) | |
bins = myprogram1 myprogram2 | |
all: $(bins) |
#include <stdio.h> | |
#include <stdlib.h> // Include stdlib for malloc and free | |
#include <limits.h> | |
#include <stdbool.h> | |
#include <string.h> | |
void sieve_of_eratosthenes(unsigned long n) { | |
// Dynamically allocate memory for the prime array on the heap | |
bool *prime = (bool *)malloc((n + 1) * sizeof(bool)); | |
if (!prime) { |