This file contains hidden or 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> | |
struct inner { }; | |
struct outer { | |
int a; | |
char b; | |
float c; | |
struct inner obj; | |
char asdf[]; |
This file contains hidden or 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 <type_traits> | |
#include <thread> | |
#include <iomanip> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <concepts> | |
#include <variant> | |
#include <iostream> | |
#include <iterator> |
This file contains hidden or 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> | |
#include<stdlib.h> | |
struct node { | |
int key; | |
struct node *left; | |
struct node *right; | |
int height; | |
}; |
This file contains hidden or 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
use std::rc::Rc; | |
use std::cell::RefCell; | |
trait Component { | |
fn attach_to(&mut self, container: Rc<RefCell<Outer>>); | |
} | |
#[derive(Debug)] | |
struct Inner { |
This file contains hidden or 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
from random import randint | |
def string_compare(s1, s2): | |
rv = len(s1) - len(s2) | |
# print(f'values: ({s1}, {s2}); {s1} > {s2} ? {rv}') | |
if rv > 0: | |
return 1 | |
elif rv < 0: | |
return -1 | |
else: |
This file contains hidden or 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
// | |
// Created by boki on 8/31/20. | |
// | |
#ifndef _CLASS_H_ | |
#define _CLASS_H_ | |
#include <stdlib.h> | |
struct Class |
This file contains hidden or 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 <iostream> | |
#include "fraction.h" | |
namespace num | |
{ | |
fraction::fraction(int n, int d) : nom(n), denom(d) { (*this).shorten(); } | |
fraction::fraction(const fraction &f) : denom(f.denom), nom(f.nom) {} |
This file contains hidden or 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 <iostream> | |
#include <fstream> | |
using std::string; | |
#define MARKS_COUNT 5 | |
struct student | |
{ | |
student(unsigned, string, int *); |
This file contains hidden or 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 <iostream> | |
using std::ostream, std::cout; | |
#include "date.h" | |
namespace ttime | |
{ | |
date::date() : day(1), month(jan), year(1970) | |
{ |
This file contains hidden or 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 <iostream> | |
#include <cstring> | |
#include "str.h" | |
namespace str { | |
str::str() : buffer(0) {} | |
str::~str() { delete[] this->buffer; } |