This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker network create pgnet | |
docker run -d --name postgres-container --network pgnet -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password -e POSTGRES_DB=mydb -v postgres-data:/var/lib/postgresql/data postgres:16.1 | |
docker run -d --name pgadmin-container --network pgnet -e PGADMIN_DEFAULT_EMAIL=admin@email.com -e PGADMIN_DEFAULT_PASSWORD=password -p 5050:80 dpage/pgadmin4:8.0 | |
REM You can now access pgAdmin at http://localhost:50505/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define DEBUG_MODE | |
#ifdef UNICODE | |
#define TCHAR wchar_t | |
#else | |
#define TCHAR char | |
#endif | |
#ifdef _DEBUG | |
#define LOG(format, val) printf(format, val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() | |
{ | |
const int ANSWER = 42; | |
int i = 0; | |
//ANSWER = 43; // Can't assign to constant | |
const int *cp; | |
cp = &ANSWER; | |
//*cp = 43; // cp points to a (const int) | |
cp = &i; // cp's contract allows to modify its contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <malloc.h> | |
#define MAX_STUDENTS 30 | |
typedef struct | |
{ | |
int id; | |
/* more fields here */ | |
} Student; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void f(int arr[]) // == void f(int *arr) | |
{ | |
size_t size = sizeof(arr); | |
printf("Size in f(): %d\n", size); | |
} | |
void main() |