Skip to content

Instantly share code, notes, and snippets.

View CalebCurry's full-sized avatar
💭
it's complicated

Caleb Curry CalebCurry

💭
it's complicated
View GitHub Profile
@CalebCurry
CalebCurry / cargo.toml
Created January 20, 2024 14:59
basic example of serializing a message, signing it, and verifying it
[package]
name = "signatures"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bls-signatures = "0.15.0"
rand = "0.8.5"
### Keybase proof
I hereby claim:
* I am calebcurry on github.
* I am calebcurry (https://keybase.io/calebcurry) on keybase.
* I have a public key ASDDn18kVSy1fD5df9a92_iwPtYDljnNa8gUDN8cfHMYTAo
To claim this, I am signing this object:
/*
So far we've covered the basics. What now?
Basically, deep dive the last section. Study up on structs, pointers, and memory management
Master input and output and data validation
Figure out how to connect to a database or file in C and make data driven applications
Study data structures and how to make them in C
- linked lists
- stack
- queue
- etc...
#include <stdio.h>
#include <stdlib.h> //required for the memory functions
#include <stdbool.h>
#include <string.h>
typedef struct user
{
char name[30];
int age;
bool isVerified;
#include <stdio.h>
#include <string.h>
struct rectangle
{
int length;
int width;
};
typedef struct position //name here is optional
#include <stdio.h>
void square(int *a)
{
*a *= *a;
//we can change value where pointer points to
}
//int getSizeIllustration (int data[])
//{
#ifndef HEADER_FILE //include guards prevent multiple includsion
#define HEADER_FILE //if not yet defined, define it
//optional but recommended
int square (int input);
int cube(int input);
int power(int input, int exponent);
int recursivePower(int input, int exponent);
void changeVal(int *a);
int oldestValue( int *ages, int size);
#include "5.2-libraries.h"
int square (int input)
{
return input * input * input;
}
int cube(int input)
{
return input * input * input;
}
/*
gcc -c 5.2-libraries.c
cc -c 5.2-libraries-main.c
gcc 5.2-libraries.o 5.2-libraries-main.o
./a.out
You can also get a custom name like this:
gcc -o main 5.2-libraries.o 5.2-libraries-main.o
//research makefile to make life easier
#include <stdio.h>
int square (int input)
{
return input * input;
}
int cube(int input)
{
return input * input * input;
}