blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
32c45c473c4e90e6e722cab0b38cfe36aae08e0c | C | mahima95/SER502-Spring2017-Team10 | /src/compiler/byte_code.c | UTF-8 | 44,363 | 2.796875 | 3 | [] | no_license | /**
* @file byte_code.c
* @brief Purpose: byte code operation
* @version 1.0
* @date 04.18.2017
* @author Rundong Zhu
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "utils/link_list.h"
#include "utils/symbol_table.h"
#include "utils/parsing_tree.h"
#include "utils/erro... | true |
004d5e3108107ec96c511ae9a0e6d9e444661ce9 | C | quangng/RaspberryPi_GPIO_device_driver | /app/collision_test/src/modgpio.h | UTF-8 | 1,002 | 2.546875 | 3 | [] | no_license | /*
* modgpio.h
*
* Created on: May 5, 2014
* Author: quangng
*/
#ifndef MODGPIO_H_
#define MODGPIO_H_
#define GPIO_IOC_MAGIC 'k'
typedef enum {MODE_INPUT=0, MODE_OUTPUT} PIN_MODE_t;
typedef enum {DIRECTION_IN = 0, DIRECTION_OUT} PIN_DIRECTION_t;
struct gpio_data_write {
int pin;
char data;
};
struct g... | true |
37930d98f60cc4724275b8ed4f783f655e8dc505 | C | akat1/securitydays | /securitydays6/finals/shell2cgi/auth.c | UTF-8 | 1,209 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#define BUF 512
#define MBUF 128
#define N 10
long long hashMe(unsigned char *str)
{
long long h = 1;
int i;
unsigned char magic_number = 0x5F;
for (i = 0; i < 8 && i < strlen((char *)str); i++) {
str[i] ^= magic_number;
h *= str[i]... | true |
60784c503014c99b2085d7978d9c0bde24c0f191 | C | francescogiordano/KCS | /crc-ccitt.c | UTF-8 | 4,925 | 3.03125 | 3 | [] | no_license | #include <stdio.h>
#include <stdint.h>
#include <string.h>
//#define POLY 0x8408
#define POLY 0x1021
/*
// 16 12 5
// this is the CCITT CRC 16 polynomial X + X + X + 1.
// This works out to be 0x1021, but the way the algorithm works
// lets us use 0x8408 (the reverse of th... | true |
a705881b5e894fdc31db32533f87a99205e5b22a | C | suisuyy/cs50 | /2/caesar.c | UTF-8 | 1,210 | 3.46875 | 3 | [] | no_license | #include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
//make sure command line argument number is 2
if (argc==2){
//check argv[1] is number
for(int i=0,len=strlen(argv[1]);i<len;++i){
if(isdigit(argv[1][i]) ){
... | true |
c07456ae69ab3739e506afd61145ccafbd12aad4 | C | DJAHIDDJ13/MicroMouse | /src/MM_brain/src/queue.c | UTF-8 | 2,220 | 3.625 | 4 | [] | no_license | #include <queue.h>
/* Create a oddpair_XY variable */
struct oddpair_XY createOddpair_XY(int16_t OX, int16_t OY, int8_t sign)
{
struct oddpair_XY XY;
XY.OX = OX;
XY.OY = OY;
XY.sign = sign;
return XY;
}
/* Initialize a stack */
Queue_XY initQueue_XY()
{
Queue_XY queue;
queue.head = queue.tail... | true |
e990888bbae23091eb19cdca8aed5f568860a459 | C | flameboss/fb-broker | /src/base64.h | UTF-8 | 608 | 2.71875 | 3 | [
"MIT"
] | permissive |
/* https://stackoverflow.com/questions/342409/how-do-i-base64-encode-decode-in-c */
#ifndef BASE64_H_
#define BASE64_H_
#include <stdint.h>
#define BASE64_OUTPUT_LEN(len) (4u * (((len) + 2) / 3))
void b64_init(void);
void b64_encode(const uint8_t *data,
uint32_t input_length,
... | true |
a3a78ca00a45cddd433779bab933f2187d811794 | C | ashroom1/Polygon-problem | /polygon.c | UTF-8 | 26,871 | 3.0625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <float.h>
#include <math.h>
#define INF INT32_MAX
//#define Test 1
/*
* Check strict math settings
* We rely on the assumption that we store the vertices in an order where there is an edge from vertex i to i + 1
* If slope is infinity c is in the form x - c = 0
* Ma... | true |
84e7bc3cc402c2f5f6a02e015bc68c11adfe08d4 | C | blackbbean/Search_Engine | /Search_Engine/Search_Engine.c | UHC | 6,347 | 3.03125 | 3 | [] | no_license | #include "Search_Engine.h"
int main() {
char c;
char word[100];
char fileName[9][100];
int word_num_sum = 0;
int comparison_sum = 0;
strcpy(fileName[0], "document1.txt");
strcpy(fileName[1], "document2.txt");
strcpy(fileName[2], "document3.txt");
strcpy(fileName[3], "document4.txt");
strcpy(fileName[4], "doc... | true |
b4cc0694d0b08a37425ae777644f7e366a9a27b6 | C | ds64/IUS4 | /INCLUDE/eeprom.h | WINDOWS-1251 | 833 | 2.703125 | 3 | [] | no_license | #ifndef __EEPROM__H
#define __EEPROM__H
#define EEPROM_ADDRESS 0xA2
#define EEPROM_SIZE 32768
/*
EEPROM :
addr ,
size ,
buf .
*/
extern bit ReadEEPROM(unsigned short address, unsigned char xdata *buf, unsigned short length);
/*
EEPROM :
addr ,
size ,
... | true |
6c726e02b556435ff74d93d0d6c9586456136679 | C | sonam-padangale/lddriver200250330072 | /sample.c | UTF-8 | 2,005 | 2.96875 | 3 | [] | no_license | #include<linux/module.h>
#include<linux/init.h>
#include<linux/fs.h>
#include<linux/cdev.h>
MODULE_LICENSE("GPL");
// GPL license used by linux kernel developer..module stacking..some driver might not compatible with non GPL
MODULE_AUTHOR("DU");
/*things need for char device
* 1.device numbe:dev no. is used by linu... | true |
b6538b57baab1e52a0c2d252f0cbc463152adf3b | C | faduzin/URI | /1018.c | UTF-8 | 646 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
int main() {
int c, v, hun, fif, twe, ten, fiv, two;
scanf("%d", &v);
c=v;
hun=c/100;
c=c-(hun*100);
fif=c/50;
c=c-(fif*50);
twe=c/20;
c=c-(twe*20);
ten=c/10;
c=c-(ten*10);
fiv=c/5;
c=c-(fiv*5);
two=c/2;
c=c-(two*2);
printf("%d\n", v);
... | true |
2506f30a8cd9514bb27ec2a46b8c4da9f477c83d | C | moxitrel/cogo | /src/cogo_await.c | UTF-8 | 1,309 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <cogo/cogo_await.h>
// should be invoked through CO_AWAIT()
void cogo_await_await(cogo_await_t* const thiz, cogo_await_t* const co) {
COGO_ASSERT(thiz && thiz->sched && co);
#ifndef NDEBUG
// no loop in call chain
for (cogo_await_t const* node = thiz; node; node = node->caller) {
COGO_ASSERT(co != ... | true |
560058fc0306d7fa0000232631d088a3fb50133b | C | SAKET71193/arm7_lpc2148 | /arm/PWM LED/pwm.c | UTF-8 | 643 | 2.546875 | 3 | [] | no_license | #include <lpc214x.h>
void delay(unsigned int time)
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<1000;j++);
}
int main()
{
unsigned int period=1000, i;
PINSEL1 &= 0xFFFFF3FF; // Pin 0.21 as PWM5 pin
PINSEL1 |= 0x00000400;
PWMPR = 0x00;
PWMMCR = 0x00000002;
PWMMR0 = period;
PWMMR5 ... | true |
475bbed1108f7fb6f2f0cfd3d367499cdb2df8e0 | C | kalinkhemka/CS111 | /lab3-design/ospfsfix.h | UTF-8 | 1,139 | 2.65625 | 3 | [] | no_license | #ifndef OSPFSFIX_H
#define OSPFSFIX_H
#include <errno.h>
#include <stdint.h>
#include "ospfs.h"
#define MAX_FILENAME_LEN 1024
//Define Error Messages
#define ERROR(msg) printf("%s in %s, Line:%d\n", msg, __FILE__, __LINE__)
#define UNFIXABLE(msg) printf("Error Unfixable: %s\n", msg)
//Define success message
#define ... | true |
3143b98a45e4516772dfebd36b46e68485a30fa7 | C | Goomelo/mjson | /mjson.c | UTF-8 | 17,477 | 2.890625 | 3 | [] | no_license | #ifdef _WINDOWS
#define _CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#endif
#include "mjson.h"
#include <assert.h> /* assert() */
#include <errno.h> /* errno, ERANGE */
#include <math.h> /* HUGE_VAL */
#include <stdio.h> /* sprintf() */
#include <stdlib.h> /* NULL, malloc(), realloc(), free(), strtod() */
#include <s... | true |
d7f0444999cbe9ea0631082574b64c74acffcd30 | C | mosiurp/c-program-problem-solve | /user input array add.c | UTF-8 | 312 | 3.453125 | 3 | [] | no_license | #include<stdio.h>
void main()
{
int i,sum=0,size;
int num[]={};
printf("Enter the number of Array size\t");
scanf("%d",&size);
printf("Array size is = %d\n",size);
for(i=0; i<size; i++){
scanf("%d",&num[i]);
sum=sum+num[i];
}
printf("Total number is = %d",sum);
}
| true |
edb47927d572fda4c3a94c2592ffeb87c7670bdc | C | paulohtobias/UFSJ_4_GRAFOS_TP1 | /src/backtracking.c | UTF-8 | 5,176 | 3.21875 | 3 | [] | no_license | #include "backtracking.h"
//Matriz com as possibilidades de cores de cada vértice.
//Cada linha i corresponde ao id vértice i
//e cada coluna j (j > 0) corresponde à cor j.
//A posição [i][0] indica quantas cores o vértice i pode assumir.
int **possibilidades;
//Inicializa a matriz de possibilidades.
void inicializa_... | true |
ce2d10aa57a6da831509f57d1019e3430e254a60 | C | 3453-315h/mirror-hack.co.za | /hack.co.za/exploits/os/linux/redhat/6.1/pamlog.c | UTF-8 | 3,434 | 2.703125 | 3 | [] | no_license | /*
Pam'Console'logger by wC
Description:
Thiz enables you to log a tty to a file! =)
According to a advisorie at www.securityfocus.com:
A vulnerability exists in the pam_console PAM module, included as part of
any Linux system running PAM. pam_console exists to own certain devices to... | true |
321f00b2bda240a22876732d057e9754ee17be77 | C | Brehm1983/Coding-Tree | /HackerEarth/Day 2 Ladies First.c | UTF-8 | 619 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#define MOD 1000000007
unsigned long long int apow(unsigned long long int,unsigned long long int);
int main(){
unsigned long long int t,n,ans,q,p;
scanf("%llu",&t);
while(t--){
scanf("%llu",&n);
ans = ((n%MOD)*apow(2,(n-1)))%MOD;
printf("%llu\n",ans);
}
}
unsigned... | true |
a326792bfff49d3d8b207e724df55678ba32d0fd | C | selvarajrojaajith/gowtham | /string.c | UTF-8 | 322 | 2.796875 | 3 | [] | no_license |
#include <stdio.h>
using namespace std;
int count(string s, int K)
{
int n = s.length();
for (int i = 0; i < n; i++) {
{
c=c+;
}
}
return C * K + (K * (K - 1) / 2) * c1 * c2;
}
int main()
{
string S = "abcb";
int k = 2;
cout << countOccurrences(S, k) << endl;
return 0;
... | true |
82b095220d2da2c5a2ad29aca0d9a40618181aab | C | omgimanerd/experimental | /c/struct.c | UTF-8 | 285 | 3.4375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main() {
typedef struct {
int i;
char c;
} foo;
foo s;
foo* t = (foo*) malloc(sizeof(foo));
s.i = 53;
s.c = 'w';
(*t).i = 64; // t->a = 75;
printf("s.i = %d, s.c = %c, t.a = %d\n", s.i, s.c, t->i);
return 0;
}
| true |
0b43d7a5fc448c0308565e6a07413ec556382dcc | C | nkkav/kmul | /test.opt.c | UTF-8 | 511 | 3.1875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-public-domain"
] | permissive | // test.opt.c
#include <stdio.h>
#include <stdlib.h>
long kmul_o_s32_p_23 (long x)
{
long t0;
long t1;
long t2;
long t3;
long t4;
long t5;
long t6;
long t7;
long t8;
long t9;
long t10;
long t11;
long t12;
long t13;
long t14;
long t15;
long y;
t0 = x;
t1 = t0 << 1;
t2 = t1 + x;
... | true |
c1ad8646930a2f69a9a23cb81a23722d9a4e7144 | C | zacrogers/Stm32Synth | /Core/Inc/adsr.h | UTF-8 | 1,004 | 2.6875 | 3 | [] | no_license | /*
* adsr.h
*
* Created on: Oct 10, 2020
* Author: Zac
*/
#ifndef INC_ADSR_H_
#define INC_ADSR_H_
#include <stdint.h>
#include <stdbool.h>
#define SAMPLE_FREQ 40000
typedef enum
{
ENV_INIT = 0,
ENV_ATTACK,
ENV_DECAY,
ENV_SUSTAIN,
ENV_RELEASE
}ADSR_STATE;
typedef struct
{
... | true |
33be53f4bbff0f90615c05bc7d83079908f43223 | C | escleur/Programacion1 | /clase7/src/clase7.c | UTF-8 | 5,074 | 3.203125 | 3 | [] | no_license | /*
============================================================================
Name : clase7.c
Author :
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#include <stdio.h>
#... | true |
fb4c70a41b3b53da4f79d06eb14fb15c0d4b90d0 | C | amfry/ExercisesInC | /exercises/ex01/cards_functions.c | UTF-8 | 1,393 | 3.671875 | 4 | [
"MIT"
] | permissive |
#include <stdio.h>
#include <stdlib.h>
int input(){
/* This function asks for the card name to be enetered
and change the value of the card value depedning on the entry*/
char card_name[3];
{
puts("Enter the card_name: ");
scanf("%2s", card_name);
int val = 0;
switch(card_name[0]) {
ca... | true |
443e756278244fa1d2871411cff2137d3dfb2789 | C | shookari/debugging | /05_day/bit/fls.c | UTF-8 | 698 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#define BITS_PER_LONG 32
unsigned long __fls(unsigned long word)
{
int num = BITS_PER_LONG - 1;
#if BITS_PER_LONG == 64
if (!(word & (~0ul << 32))) {
num -= 32;
word <<= 32;
}
#endif
if (!(word & (~0ul << (BITS_PER_LONG-16)))) {
num -= 16;
word <<= 16;
}
if (!(word & (~0ul << (BITS_PER... | true |
36f3bb038068d98ddec4fdcf927aeab451e7ccb5 | C | stupidtang/Compiling-Principle | /scanner.c | UTF-8 | 4,193 | 3.5625 | 4 | [] | no_license | //实验一 词法分析器
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
char *Key[8]={"begin","integer","function","if","then","else","read","write"}; //定义保留字(关键字)
char ch; //新读入字符
char token[20]; //已读入字符
int letter(char c){ //判断字母的函数
if(... | true |
c3c561b0a5a95c9b7169cae85e610e38de4a1e40 | C | 15831944/barry_dev | /src/binlog/tester/reader.c | UTF-8 | 383 | 2.609375 | 3 | [] | no_license |
#include "binlog.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#define LEN 1024
int readlog(void)
{
char buf[LEN]="BUF";
int ret=0;
ret = binlog_read(buf,LEN,0);
printf("ret=%d,err=%s\n",ret,strerror(errno));
if(ret>0)
{
buf[ret]=0;
printf("buf=%s\n",buf);
}
return... | true |
e102cf074a4e33ff1450873a8afda0f6b5fc0e7b | C | ahuglajbclajep/verifast-exercises | /examples/bank-account/src/main.c | UTF-8 | 523 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <assert.h>
#include "account.h"
int main()
//@ requires true;
//@ ensures true;
{
account_t* my_account = create_account(-100);
account_deposit(my_account, 200);
int w1 = account_withdraw(my_account, 50);
assert(w1 == 50);
int b1 = account_get_balance(my_account);
assert(b1 ... | true |
d1ebf079b0539620a1a8a4799084c5686f32940f | C | b04902009/2015-C_programming | /50012. Block Mover/blockmover.c | UTF-8 | 957 | 3.28125 | 3 | [] | no_license | void printBlock(unsigned long long int *block)
{
for(int i = 0;i < 64;i ++){
printf("%lld",(*block>>i)&1ULL);
if((i & 7) == 7) printf("\n");
}
}
void initialize(unsigned long long int *block, int row, int column, int size)
{
*block = 0;
unsigned long long add = (1ULL << size) -1;
... | true |
3e58cf0cc96efceab62a6e929e9e443038f1967b | C | pranshulnarang/KRRSG-Task-Round | /tasks/task1/gru.c | UTF-8 | 4,912 | 2.875 | 3 | [] | no_license | #include <arpa/inet.h>
#include <netinet/in.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#define total_minions 3 //use this to define total no. of receiving minions
int indicator =1;
int number=0;... | true |
1d0b31ec9df0b97aa0f8c4fc1550fa563f427ad5 | C | barmi/WindowsProgramming2016 | /week02/Structure1_c/Structure1.c | UHC | 357 | 2.796875 | 3 | [] | no_license | // Structure1.cpp : ܼ α մϴ.
//
#include "stdafx.h"
struct Student {
// Student ̸ ڷ
char name[10]; // ̸
char address[20]; // ּ
int Year; // г
};
int main()
{
int a = 10;
Student s; // struct Student s;
system("pause");
return 0;
}
| true |
73f6450f17c598eea32125b74ef1e9cc74f3e544 | C | RachData/graphe | /Projet_Graphe/connexe_Nayima/Implementer.c | UTF-8 | 3,225 | 3.34375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct { //graphe représenté par une matrice d'adjacence
int nombre_sommet;
int ** matrice_adjacence;
} graphe;
void affiche_graphe(graphe G){
int i,j;
printf("Graphe avec %d sommets \n",G.nombre_sommet);
for(i = 0; i<G.nombre_sommet; i++){
... | true |
b44dbf6fae2791aedf5e14e8267c79eace466697 | C | MingSeng-W/pat-practice | /linearList/stack.c | UTF-8 | 955 | 3.75 | 4 | [] | no_license | // 2.2堆栈
#include "stdio.h"
#include "stdlib.h"
//堆栈的链表实现
typedef int ElemType;
typedef struct Snode *PtrlToSNode;
struct Snode
{
ElemType data;
PtrlToSNode next;
};
typedef PtrlToSNode Stack;
Stack createStack(){
Stack s;
s=(PtrlToSNode)malloc(sizeof(Snode));
s->next=NULL;
return s;
}
//判空
bool Empty(Stack ... | true |
acd73e961209a4a7f8b74d756f4e79076fe725d5 | C | RetroBSD/retrobsd | /src/cmd/disktool/disktool.c | UTF-8 | 6,657 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Disk testing utility.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#define BLOCKSZ 1024
char *progname;
int verbose;
int fd;
void block_write (unsigned bn, unsigned char *data)
{
unsigned addr = bn * BLOCKSZ;
int ret, i;
if (verbose) {
... | true |
4f5933f6587e74234ce23fa81bfe97d351a53e28 | C | kbranigan/tubes | /src/unique.c | UTF-8 | 2,200 | 3.046875 | 3 | [] | no_license |
#include "block.h"
int main(int argc, char ** argv)
{
if (stdout_is_piped()) // other wise you don't see the seg fault
setup_segfault_handling(argv);
assert_stdin_is_piped();
assert_stdout_is_piped();
//assert_stdin_or_out_is_piped();
static char column_name[1000] = "";
static int sort_that_colu... | true |
6b1d7eaa0f01b2845debc11fc8d0ffb11a29ebce | C | caiwaifung/algo | /template/geo/_/2d/[old] 2D_common.h | UTF-8 | 1,952 | 3.53125 | 4 | [] | no_license | const double EPSI = 1E-8;
double sqr(double x) { return x * x; }
int sgn(double x) {
if (x > EPSI) return 1;
if (x < -EPSI) return -1;
return 0;
}
struct Point {
double x, y;
Point() { }
Point(double _x, double _y) : x(_x), y(_y) { }
void read() { scanf("%lf%lf", &x, &y); }
Point operator +(Point p) const { ... | true |
4ffc5e717ca274b240589749f49fa52509c104a2 | C | csijh/snipe | /src/events.h | UTF-8 | 3,327 | 2.578125 | 3 | [
"ISC"
] | permissive | // Snipe event handling. Free and open source. See licence.txt.
// TODO: detect shift-click for select, ctrl-click for add cursor
// TODO: touch scroll
#include "settings.h"
// Event code constants represent keyboard, mouse, window and timer events.
// These constants are intended to be independent of the graphics lib... | true |
891d68dad7bc3d6bd6c37df92f535d59d125918b | C | Oksanatishka/42_exam_beginner | /level_2/ft_strdup/ft_strdup.c | UTF-8 | 777 | 3.921875 | 4 | [] | no_license | /*
Assignment name : ft_strdup
Expected files : ft_strdup.c
Allowed functions: malloc
--------------------------------------------------------------------------------
Reproduce the behavior of the function strdup (man strdup).
Your function must be declared as follows:
char *ft_strdup(char *src);
*/
#include ... | true |
afcc919ff8aab6b96f065a73576dd50119e05907 | C | ksheedlo/kmdata | /list.h | UTF-8 | 1,278 | 2.703125 | 3 | [] | no_license | /* Ken Sheedlo
* Simple circularly linked list implementation */
#include "tuple.h"
#include "error_handling.h"
struct _ll_t; /*Forward declaration*/
typedef struct _ll_node {
void *data;
struct _ll_t *list;
struct _ll_node *next;
struct _ll_node *prev;
} node_t;
typedef struct _ll_t {
node_t... | true |
7e306597dda81718a2867781b609689374745591 | C | Tomson1227/uchat | /client/src/utils.c | UTF-8 | 1,384 | 2.90625 | 3 | [] | no_license | #include "uchat.h"
char *my_itoa(long long number) {
char *str = (char *)malloc(21);
int count = 0;
unsigned long long num;
int flag = 0;
if(number & 0x8000000000000000) {
flag = 1;
str[count++] = '-';
num = (number ^ 0xFFFFFFFFFFFFFFFF) + 1;
}
else
num = (unsigned long long) number;
if(nu... | true |
2c13b7594859ac4a570ec7225571b73d04edee5a | C | gateway17/holbertonschool-low_level_programming | /0x07-pointers_arrays_strings/1-memcpy.c | UTF-8 | 448 | 3.6875 | 4 | [] | no_license | #include "holberton.h"
/**
*_memcpy - Copy characters for one array and paste in other,
*@dest:Is the array where are going to be paste the characters.
*@src:Is the array from is going to be copied,
*@n:Mount of characters that are going to be copied.
*Return:The array dest.
*/
char *_memcpy(char *dest, char *sr... | true |
93d86ed3cacee41d2e0e9b868370946dbb04b6fd | C | ryu-raptor/rev-poland-calculator | /rpnStack.c | UTF-8 | 395 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #include "rpnStack.h"
#include "Stack.h"
#include "TokenType.h"
void initrpnStack(rpnstack* st)
{
init(&(st->data));
init(&(st->type));
}
void rpnpush(int data, etype e, rpnstack* st)
{
push(data, &(st->data));
push((int)e, &(st->type));
}
rpndata rpnpop(rpnstack* st)
{
rpndata rv;
rv.data = ... | true |
86b5101f17d7a8759949e14463018b946e3f4c56 | C | dev-go/hello-world | /linux/04 thread/src/cleanup.c | UTF-8 | 1,230 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright (c) 2020, devgo.club
// All rights reserved.
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <pthread.h>
void th_cleanup_func(void *arg)
{
char *msg = (char *)arg;
printf("[%ld] cleanup: msg = %s\n", pthread_self(), ms... | true |
d8ab966db4fdecdc7d96fad45aeff6c7c1a24986 | C | zarco94/2anno | /1 semestre/Algoritmi/Violetta/Esercizi/A casa/4settimana/1orario.c | UTF-8 | 406 | 3.625 | 4 | [] | no_license | #include <stdio.h>
void split_time ( long int tot_sec, int *h, int *m, int *s );
int main(void){
int h,m,s,tot_sec;
scanf("%d", &tot_sec);
split_time(tot_sec, &h, &m, &s);
printf("%d sono %d h %d m %d s\n", tot_sec,h,m,s);
}
void split_time ( long int tot_sec, int *h, int *m, int *s ){
*h = tot_s... | true |
d814925951439b9d0469cbcefc3dd3c72aaf11d3 | C | rroland20/Get_next_line | /get_next_line.c | UTF-8 | 2,224 | 3.015625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... | true |
b4a373ee49ba46f820cd7ee0725ae1525168d720 | C | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/47/3011.c | UTF-8 | 188 | 2.625 | 3 | [] | no_license |
int main(void)
{
int a[100],n;
cin >>n;
for (int i=0;i<=n-1;i++)
{
cin >>a[i];
}
for (int i=n-1;i>=0;i--)
{
cout <<a[i];
if (i!=0) cout <<" ";
}
return 0;
} | true |
a5a7f9fc60e6ac8c7fac84615f88dd3773fb7913 | C | saket777/C-Codes | /Reverse of a number.c | UTF-8 | 265 | 3.59375 | 4 | [] | no_license | #include<stdio.h>
int main(){
int n, rev=0,remainder;
printf("Enter an integer:");
scanf("%d",&n);
while(n!=0){
remainder = n%10;
rev = rev*10+remainder;
n=n/10;
}
printf("Reverse of a number=%d",rev);
return 0;
} | true |
2061ca73b8dc027a3c82b610c04c32d8b05c5f3b | C | Blanchard-A/TekAdventure | /src/diff_way.c | UTF-8 | 1,798 | 2.984375 | 3 | [] | no_license | /*
** diff_way.c for main in /home/blanch_p/rendu/Semestre2/Infographie/
**
** Made by Alexandre Blanchard
** Login <blanch_p@epitech.net>
**
** Started on Wed Apr 13 14:06:34 2016 Alexandre Blanchard
** Last update Sun Apr 17 22:32:26 2016 Alexandre Blanchard
*/
#include "adventure.h"
int check_first(int dep, t... | true |
c3b4d5fedfd8e4dfc3c0f97073b478ac061501aa | C | Noyda42/minishell | /libft/get_next_line.c | UTF-8 | 1,855 | 3.015625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_next_line.c :+: :+: :+: ... | true |
a8862371fbafa5f4d8dbbd89a937ea0e33e6e45a | C | Covvperwood/myc | /2.1.c | UTF-8 | 766 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int n, i,r, min_elem_ind = 0, max_elem_ind = 0 ;
printf("Enter the length of massive\n");
scanf("%d", &n);
int a[n];
for (i = 0; i<n; i++){
scanf("%d", &a[i]);
}
for (i = 0; i<n; i++){
printf("%d ", a[i]);
}
fo... | true |
fcc995dc9f543938b8be81d814e8784e19629c7e | C | k-plokho/CS50 | /week1/pset1/greedy.c | UTF-8 | 958 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
#include <math.h>
#include "cs50.h"
int main(void)
{
float change;
int coin = 0, converted;
//user's input
do
{
printf("How much change do you have?\n");
change = GetFloat();
}
while (change < 0);
//convertation into cents
change *... | true |
0369b1212bf40b92a0156b23db714df9a7575f1c | C | constpe/Words-counting-processes | /lab_3.c | UTF-8 | 5,317 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#include <dirent.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <locale.h>
#include <wchar.h>
#include <wctype.h>
#include <x86_64-linux-gnu/sys/types.h>
#include <x86_64-linux-gnu/sys/stat.h>
#incl... | true |
84181811dd5fb98f279cde4ef718a14626e84b6d | C | coryc257/TLPI | /9/proccred/idshow.c | UTF-8 | 1,964 | 2.65625 | 3 | [] | no_license | /*
* idshow.c
*
* Created on: May 16, 2021
* Author: cory
*/
#include "../lib/9_hdr.h"
#include <unistd.h>
#include <sys/fsuid.h>
#include <limits.h>
#include "8_hdr.h"
#include "tlpi_hdr.h"
#define SG_SIZE (NGROUPS_MAX + 1)
#define DISPLAY_USERNAME(user) user == NULL ? "???" : user
#define DISPLAY_GROUPN... | true |
ac69b978f77d3876a3db67be91233f5dbb0295ae | C | LeoTheLegion/Motor-control-with-light-sensor | /main.c | UTF-8 | 646 | 2.859375 | 3 | [] | no_license | #include <msp430.h>
#include <Output.h>
#include <Authenticator.h>
//output
#define MOTOR BIT2
//input
#define BUTTON BIT3
/*
*Our driver.
* */
void setup(){
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
setupOutput((MOTOR)); //Declare OUTPUTS
setupInput(BUTTON); //Declare INPUTS
setOu... | true |
099a611d65e18cce702f3b22d17702ce2b2f28b4 | C | jiaobendaye/c-learn | /maNongYouDao/c/book15.c | UTF-8 | 648 | 4.34375 | 4 | [] | no_license | /*
* 此程序演示算术运算符的使用
* 作者:豫让 日期:20190525
*/
#include <stdio.h>
int main()
{
double A=18; // 定义变量A,赋值18
double B=5; // 定义变量B,赋值5
printf("A的值是:%lf\n",A);
printf("B的值是:%lf\n",B);
printf("A+B的值是:%lf\n",A+B);
printf("A-B的值是:%lf\n",A-B);
printf("A*B的值是:%lf\n",A*B);
printf("A/B的值是:%lf... | true |
e92c53f9987d50689370d0dee23906042ba55198 | C | newcom1/c_test | /crc/char2x.c | UTF-8 | 518 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char data[] =
"D2BCD2BCD2BCD2BCD2BCD2BCD2BCD2BCD2BCD2BCD2BCD2BCB7A1B7A1B7A1B7A1B7A1B7A1B7A1B7A1B7A1B7A1B7A1B7A1C8FEC8FEC8FEC8FEC8FEC8FEC8FEC8FEC8FEC8FEC8FEC8FECBC1CBC1CBC1CBC1CBC1CBC1CBC1CBC1CBC1CBC1CBC1CBC1CEE9CEE9CEE9CEE9CEE9CEE9CEE9CEE9CEE9... | true |
f3799de1c7177556bc198873503d6f02458e66cb | C | npetrosian/UCSC | /CMPS101/programAssignments/PA2/Graph.h | UTF-8 | 891 | 2.5625 | 3 | [] | no_license | //---------------------------
// Name: Natalie Petrosian
// UserID: npetrosi
// Assignment: PA2
//---------------------------
#include "List.h"
#define UNVISITED 0
#define INPROGRESS 1
#define ALLDONE 2
#define FOUND 3
#define NOTFOUND 4
#define MAX_ARRAY_SIZE 256
typedef struct GraphObj {
int... | true |
a699ff4bafbe563b0572ac4b41d9e498fdf26863 | C | sonuishaq67/cprograms | /basic/ayo.c | UTF-8 | 1,123 | 4.25 | 4 | [] | no_license | /*
Define a student structure with University Seat Number (USN), name (FirstName, LastName),
and marks in 3 subjects as members of that structure with nesting. Write a C program to read
the information for one student and print the same.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct m... | true |
9b26176eb346abb471afeaa68310280a61073c8e | C | WuXing918/test | /pthread/01createpthread.c | UTF-8 | 1,800 | 3.25 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
#include <pthread.h>
//线程函数
/*
线程除了自己私有的堆栈和寄存器以外其他的都是共享的!
*/
void* pthreadone(void *num)
{
//将本线程设置为分离线程
pthread_detach(pthread_self());
printf("I am pthread one!\n");
pthread_exit("exit");
}
void* pthreadtwo(void *num)
{
//创建的线程默认为绑定线程
printf("I am pthread two!\n");
}
int ... | true |
844ee89f1d3d2c67cd3a847b77fa4b0b4e79b16c | C | Shaligram/spworks | /C/binarysem.c | UTF-8 | 1,023 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <semaphore.h>
#define LIMIT 1000
sem_t sem1,sem2;
void* function1(void *p)
{
int expected = *(int *)p;
while(expected < LIMIT) {
sem_wait(&sem1);{
printf("Even %d\n", expected);
expected += 2;
... | true |
631e700810e819482f49883886b27bd2d71b7b14 | C | ChasobaAlpacanist/cfiles | /20181116(random)/study_work/1-2.c | UTF-8 | 738 | 3.921875 | 4 | [] | no_license | #include <stdio.h>
#include <assert.h>
// f(n + 1) = f(n) + f(n - 1)
int fibo_loop(int index){
if(index < 2){
return 1;
} else {
int value = 1, value_before = 1; //define f(0) and f(1)
int tmp = 0;
while(index > 1){
tmp = value;
value += value_before;
value_before = tmp;
ind... | true |
76901efa486acc442fd1de8e70689309720b4df0 | C | OKC-RW/LL1-Compiler | /src/global.h | GB18030 | 850 | 2.53125 | 3 | [] | no_license | #ifndef __LAB8_GLOBAL__
#define __LAB8_GLOBAL__
enum{ //32 terminals //ս1ʼʷķֵͻ
IF=1, ELSE, WHILE, DO, BREAK, TRUE, FALSE, INT, BOOL, AND, OR, NOT, EQ, NE, GT, GE, LT, LE, SET, ADD, SUB, MUL, DIV, SC, LP, RP, LB, RB, LSB, RSB, ID, NUM
};
enum{ // non-terminals & auxiliaries
PRO, BLO, DECLS, DECL, TYP, TYPP, BASIC... | true |
d3bba04d153d26779106de6cf72bc4cd02a5b8f4 | C | Vatoth/CPE_2016_Lemin | /bonus/lib/my_putnbr_base.c | UTF-8 | 1,508 | 3.328125 | 3 | [] | no_license | /*
** my_putnbr_base.c for my_putnbr_base in /home/lblanchard/PSU_2016_my_printf
**
** Made by Leandre Blanchard
** Login <lblanchard@epitech.net>
**
** Started on Wed Nov 9 11:32:20 2016 Leandre Blanchard
** Last update Sun Apr 30 17:16:24 2017 Léandre Blanchard
*/
#include "my_printf.h"
int part_of_base(c... | true |
37b9008a9b95038de3969311c611d6161ec0db26 | C | showmind1215/get_music_pic | /extractPic_mp3.c | UTF-8 | 2,919 | 2.65625 | 3 | [] | no_license | /*
* @Brief:
* This file is for extracting picture from mp3 file.
* @References:
* http://blog.csdn.net/ydtbk/article/details/9258651
* http://magiclen.org/mp3-tag/
*/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "extractPic.h"
// id3v2 header tag structure
typedef str... | true |
a3352773535a86d76eab105947de8a8bf8bbfa55 | C | dushan42/thegrid | /src/Font.h | UTF-8 | 916 | 3.1875 | 3 | [] | no_license | #ifndef GAME_FONT_H
#define GAME_FONT_H
#include "Texture.h"
struct Font
{
Texture texture;
int charWidth[256];
int startChar;
int fontHeight;
int cellWidth;
int cellHeight;
int imageWidth;
int imageHeight;
int numRows;
int numCols;
};
/**
... | true |
2dde95c96b0f5c1162b3ae6a3c872b473076f2e3 | C | openmv/openmv | /src/omv/imlib/collections.c | UTF-8 | 10,714 | 2.78125 | 3 | [
"MIT"
] | permissive | /*
* This file is part of the OpenMV project.
*
* Copyright (c) 2013-2021 Ibrahim Abdelkader <iabdalkader@openmv.io>
* Copyright (c) 2013-2021 Kwabena W. Agyeman <kwagyeman@openmv.io>
*
* This work is licensed under the MIT license, see the file LICENSE for details.
*
* Common data structures.
*/
#include "iml... | true |
9b3e3a6f861bf1610833ebe94a94772c3cc930e3 | C | josulf/Morsee | /libMU_Demos/lib/uip_app/special_server.c | UTF-8 | 3,549 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* \addtogroup apps
* @{
*/
/**
* \defgroup special_server Special webserver
* @{
*
* This example shows a simplified webserver that always responds with the same information.
*/
/**
* \file
* Implementation of the HTTP client.
* \author Eñaut Muxika <emuxika@eps.mondragon.edu>
*/
#i... | true |
74df1e8dec7d70127ec60fdc37abdf328d6671d8 | C | peichangliang123/ToolBank | /domain_name_to_ip/url_prase.c | UTF-8 | 8,852 | 3 | 3 | [] | no_license |
#include <stdio.h> //printf
#include <sys/socket.h>
#include <netdb.h> //hostent
#include <arpa/inet.h>
#include <string.h>
//#include "hle_url_prase.h"
typedef struct _url_info_t
{
char*protocol; //协议
char*host; //域名
char*port; //端口
char*path; //路径
char*query; //询问
c... | true |
9e6a78ea731c3c3d2762063789bc3a39263dc7c0 | C | atafoa/algorithms- | /Lab 1/lab1.c | UTF-8 | 3,182 | 4.09375 | 4 | [] | no_license | /* Lab 1
CSE 2320 - Lab 1
Created By Atafo Abure 1001442575
This program is going to help you predict the outcome of a mergesort using binary search. It will required the inputs for the two arrays and the number of probes
Feb 6 2018
How to run
To compile and run use the following commands
gcc lab1.c
a.out < ... | true |
843f89002a4c69b47342f3d1e549c86dee76d8b2 | C | Unidata/LDM | /misc/errorTest.c | UTF-8 | 1,048 | 2.796875 | 3 | [
"BSD-2-Clause"
] | permissive | #include <limits.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "error.h"
#include "log.h"
int
main(int argc, char* args[])
{
int status;
if (log_init(args[0])) {
perror("log_init()");
status = 1;
}
else {
ErrorObj* err;
(void)log_set_level(LOG_... | true |
685628cf595358c124da66511303bfc76c418bc1 | C | ckl666/leetcode | /字符串的全排列.c | UTF-8 | 1,095 | 3.453125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <assert.h>
//递归,字符串的全排列
void Swap(char *s1,char *s2)
{
char tmp = *s1;
*s1 = *s2;
*s2 = tmp;
}
int IsSwap(char *begin,char *end)
{
assert(begin != NULL && end != NULL);
char *p = begin;
for(p; p < end; p++)
{
if(*p == *end)
{
... | true |
83f3ca06963420eb5adc0e93461e074a89a7a26a | C | raveena17/c-programs | /ARITHOP.C | UTF-8 | 106 | 2.578125 | 3 | [] | no_license | #include<stdio.h>
void main()
{
float a, b;
clrscr();
a = 10;
b = 3;
printf("%f", a/b);
getch();
}
| true |
7897c5be1f6f29ba9621ecd73eb0679b6fc66ad2 | C | dwoodbur/CS12B | /lab6/nsort.c | UTF-8 | 3,178 | 3.078125 | 3 | [] | no_license | // $Id: nsort.c,v 1.1 2011-04-29 19:46:42-07 - - $
#include <assert.h>
#include <libgen.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <stdbool.h>
#include <unistd.h>
#include <string.h>
#define OPTION "d"
typedef struct node node;
struct node {
double item;
node *link;
};
int exit_... | true |
47a11bb7eb6284e6c56d8b1055f58a7fa46553ef | C | pyav/labs | /src/datastructures/lowest_common_ancester.c | UTF-8 | 2,423 | 4.375 | 4 | [] | no_license | /*
* This program finds the lowest common ancester in a BST
*
* Author: @pyav
*/
#include <stdio.h>
#include <stdlib.h>
#define SUCCESS 0
#define FAILURE 1
/* Node structure */
struct node {
int data;
struct node *left;
struct node *right;
};
/* Create a new node */
struct node *new_node(int data)
{
st... | true |
a473ab5bbd9d9a46b633c5282baa84036e29e392 | C | shivanshjoshi28/My-Daily-Codes | /Arrangement_without_repitation.c | UTF-8 | 729 | 3.234375 | 3 | [] | no_license |
\\program to print the arrangemet of the string... when repitation is not allowed in the program
#include <stdio.h>
void recursion(int arr[], int data[], int start, int end, int index, int r)
{
if (index == r)
{
if(data[0]+data[1]+data[2]==0)
{
for (int j=0; j<r; j++)
p... | true |
f99546d9a7b51ac83c6668030d8c07b0e445b6a2 | C | skysbird/alg | /fsm-matcher.c | UTF-8 | 1,723 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
/**
*Finite Machine Matcher Preprocess
*/
//character set is a-z
//character mapping function
int charvalue(char c){
return c-'a';
}
//check a is b suffix
int is_suffix(char *a, char *b,int length_a,int length_b){
if (length_a > length_b){
return 0;
}
i... | true |
d4e4b5114a57fcdc89cc36b4530c46500633e641 | C | shehryarnaeem/SamplePrograms | /HackerRank/CircularArrayRotation.c | UTF-8 | 811 | 2.515625 | 3 | [] | no_license | #include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#inc... | true |
a301c9a0cae742afe12fc9db07be5c0199f6ea1e | C | VaishnaviJH/APS-libraries | /insertionsort.c | UTF-8 | 465 | 3.546875 | 4 | [] | no_license | #include<stdio.h>
void main()
{
int n,i,j,temp;
printf("enter the number of values");
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
temp=a[i];
for(j=i;j>0;j--)
{
if(a[j-1]>temp)
{
... | true |
9278298410ec05f9d6717280ebf59292e1440217 | C | lnjng/parallel-computing | /TP3/tests/grid.c | UTF-8 | 3,492 | 3.125 | 3 | [] | no_license | #include <assert.h>
#include "grid.h"
#define SIZE_X 3231
#define SIZE_Y 1234
int main() {
grid_t* grid1 = grid_create(SIZE_X, SIZE_Y, 0);
assert(grid1 != NULL);
assert(grid1->data != NULL);
assert(grid1->width == SIZE_X);
assert(grid1->height == SIZE_Y);
assert(grid1->padding == 0);
asse... | true |
f20790937b68820e0ac96b3fb6cc2999982fbfa0 | C | mdawidowski/Wspolbieznosc | /Lab5/klient.c | UTF-8 | 845 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <linux/stat.h>
#include <fcntl.h>
#include <string.h>
#define SERWERFIFO "serwerfifo"
#define KLIENTFIFO "klientfifo"
#define PERM 0777
int main(int argc, char const *argv[]) {
FILE *input;
int output, licz=20;
char liczba[7... | true |
426172e9d052d9afab9ef301c656aa83179cfe6c | C | CezarBarrera/prbb18118 | /Lesson 08/Recursion/main.c | UTF-8 | 342 | 3.546875 | 4 | [] | no_license | #include "main.h"
void main()
{
getNumber();
printFib();
getch();
}
void getNumber()
{
printf("Enter your number: ");
scanf_s("%d", &number);
}
int calcFib(int count)
{
if (count < 2) return 1;
else return calcFib(count - 1) + calcFib(count - 2);
}
void printFib()
{
printf("%d Fibonacci number is %d", numbe... | true |
6792a928416d717192e1f003b7da9704e6fd7b6a | C | jacquesrott/icecore | /src/mtree.c | UTF-8 | 5,625 | 2.71875 | 3 | [
"MIT"
] | permissive | #include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "mtree.h"
#include "cursor.h"
#include "error.h"
#include "utils.h"
#include "_tree.h"
#define CHILD(tree, depth, node, i) _TREE_CHILD(tree, depth, node, i, MTreeNode)
#define ROOT(tree) _TREE_ROOT(tree, MTreeNode)
#define TREE(node) _TREE_TREE(node... | true |
743bbd06e003f0c10a93c486c43feaee303b1bca | C | ARAGroupGIA/arapractice0-ARAlbormar | /Exercise1/exercise1.c | UTF-8 | 410 | 3.8125 | 4 | [] | no_license | /******************* Problem definition **********************************/
/* Implement a program that it shows the message "Hello World" on screen. */
/*************************************************************************/
/* Here, you must include the required libraries */
#include <stdio.h>
void main( ... | true |
aaf82053c8de6832097d207cc11b73cbb40c20c7 | C | kanmars/RedBlackTree | /rbt_1.c | GB18030 | 6,726 | 3.484375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
const int RED = 0;
const int BLACK = 1;
typedef struct rb_node rb_node;
struct rb_node{
rb_node* lchild, *rchild, *parent;
int key, colour;
};
rb_node* root;
rb_node* get_node(rb_node* parent, int key);
void rb_insert(int key);
rb_node* rb_search(int key);
void rb_dele... | true |
d6685fec0543d4a943e37845ff9af0c6faee1b27 | C | Az-dev/NVM_Stack | /EEPROM_INT.c | UTF-8 | 3,579 | 2.90625 | 3 | [] | no_license | /*
* EEPROM_INT.c
*
* Created: 28/04/2020 23:37:28
* Author: sony
*/
#include "EEPROM_INT.h"
#include "EEPROM_INT_CFG.h"
#include "avr/io.h"
#define IDLE 1
#define BUSY 2
#define DONE_WR 3
#define DONE_RD 4
static uint8_t EEINT_SM1;
static uint8_t EEINT_SM2;
void EEINT_Init(void)
{
EEINT_SM1 = IDLE;
EEI... | true |
230f7614df1a2b51023ad29819e76d51f19c91bd | C | axismaxis/Microcontrollers | /Track 2/Opdracht4/Opdracht 4/src/main.c | UTF-8 | 2,551 | 2.6875 | 3 | [] | no_license | #define F_CPU 8000000
#include <avr/io.h>
#include <util/delay.h>
#include <avr/interrupt.h>
#define sbi(x,y) x |= _BV(y) //set bit
#define cbi(x,y) x &= ~(_BV(y)) //clear bit
#define tbi(x,y) x ^= _BV(y) //toggle bit
#define is_high(x,y) ((x & _BV(y)) == _BV(y))
typedef struct {
unsigned char data;
unsigned int d... | true |
171668d501612e89454b402c38642c36a641841d | C | infLucasinf/inf029-LucasFonseca | /Atividades/recursiva/Q13.c | UTF-8 | 317 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int ordemCrescente_PAR(int N);
int main (){
int N = 10;
ordemCrescente_PAR (N);
}
int ordemCrescente_PAR(int N){
if ( N < 0 ){
return 0;
} else {
ordemCrescente_PAR( N - 1 );
printf("%d\n", N);
}
return 0;
}
| true |
1df76216e6a932169230d3909a6ab94d87073b3f | C | corundum/corundum | /lib/mqnic/mqnic_res.c | UTF-8 | 841 | 2.75 | 3 | [
"BSD-2-Clause-Views",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // SPDX-License-Identifier: BSD-2-Clause-Views
/*
* Copyright (c) 2023 The Regents of the University of California
*/
#include "mqnic.h"
#include <stdio.h>
#include <stdlib.h>
struct mqnic_res *mqnic_res_open(unsigned int count, volatile uint8_t *base, unsigned int stride)
{
struct mqnic_res *res = calloc(1, s... | true |
0b9dfb4779e12501c6660877f9412de11ac90d0c | C | townim-faisal/C-example-and-student-management-system | /Lab2/Assignment2.c | UTF-8 | 563 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
void main(){
int x,y;
printf("Enter amount:");
scanf("%d", &x);
y= x/500;
printf("500: %d\n", y);
x = x - (y*500);
y = x/100;
printf("100: %d\n", y);
x = x - (y*100);
y= x/50;
printf("50: %d\n", y);
x = x - (y*50);
y = x/20;
printf("20: %d\n", y... | true |
17f665afd2e85a9aa484eeebbdcb8e2bac94151e | C | ivorymood/TIL | /DSA_DOIT/10/1002/BinTree_Q2.c | UHC | 472 | 2.859375 | 3 | [] | no_license | /* ˻Ʈ α(ҽ) */
#include <stdio.h>
#include <stdlib.h>
#include "Member.h"
#include "BinTree.h"
/*--- ˻ ---*/
BinNode* Search(BinNode* p, const Member* x);
/*--- ---*/
BinNode* Add(BinNode* p, const Member* x);
/*--- ---*/
int Remove(BinNode** root, const Member* x);
/*--- 带 ---*/
void PrintTree(const BinNode... | true |
de076876a9c9ff2037cc8003a5bcce8454bac772 | C | shonenada/queue-chat | /src/server.c | UTF-8 | 2,798 | 2.671875 | 3 | [] | no_license | #include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/msg.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include "structs.h"
#include "parser.h"
ServerEnv serverEnv;
int loadFromFile() {
int i;
ServerEnv* env = &serverEnv;
FILE*... | true |
ffcfbc3ceb81d7803ebdd89186bb20a2d70004e6 | C | Tii-Chaton/42_push_swap | /push_swap.c | UTF-8 | 1,931 | 3.015625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.c :+: :+: :+: ... | true |
6eb73c4c46d21ec0880d44ece92e436341145238 | C | 0220facu/Grupo7 | /codigo/tp2.c | UTF-8 | 6,030 | 3.890625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <math.h>
int punto1();
int punto2();
int punto3();
int punto4();
int punto5();
int punto6();
int punto7();
int punto8();
int punto9();
int punto10();
int punto11();
int punto12();
int punto13();
int ... | true |
70027c5bb7f7146dd2883232d81624391c8ce3e5 | C | profding-bh/datastructure | /chapter.06/e.g.6.6/queue.c | UTF-8 | 2,106 | 3.6875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "queue.h"
//构建一个队列
bool init_queue(s_queue *queue, int ele_size, void (*free_data)(), void (*visit_data)())
{
if (queue == null)
{
return false;
}
queue->ele_size = ele_size;
queue->free_data = free_data;
queue->visit_data = visit_data;
queu... | true |
86736f7d7a152420a45bf759ef15a0f36737db15 | C | S2ealea/leetcoding | /challenge-111/solution-01/src.c | UTF-8 | 656 | 3.453125 | 3 | [
"MIT"
] | permissive | /*
* Challenge 111
* Find the binary tree min depth
*/
#include <stdio.h>
int main(int argc, char const *argv[])
{
/*Solution */
/* Definition for a binary tree node.*/
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
};
int minDepth(struct Tre... | true |
3edc2d8e3cc2a8f79cb9b16fb012ac8f1f3e1ff7 | C | BiniyamMelaku2/binary_trees | /12-binary_tree_leaves.c | UTF-8 | 517 | 3.671875 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include "binary_trees.h"
/**
* binary_tree_leaves - counts the leaves of a binary tree
* @tree: is a pointer to the root node of the tree
* Return: the leaves count of tree, otherwise 0
*/
size_t binary_tree_leaves(const binary_tree_t *tree)
{
size_t lleft = 0, lright = 0;
i... | true |
7261109078a49300c0d272b06db1127a24ac2efc | C | TMFRook/semgrep-rules | /c/lang/correctness/goto-fail.c | UTF-8 | 349 | 2.859375 | 3 | [] | no_license | #include <stdio.h>
int
ok() {
// ok
if (0) {
goto ONE;
goto ONE;
}
printf("did not go to one\n");
return 0;
ONE:
printf("went to one\n");
return 1;
}
int
main(int argc, char *argv[]) {
// ruleid:double_goto
if (0)
goto ONE;
goto ONE;
printf("did not go to one\n");
return 0;
ONE:
printf("w... | true |
0d26b76f0b31ee42d0ba52ec975fa4749e0b3870 | C | zjamali/miniRT_42 | /src/parsing_objects3.c | UTF-8 | 2,249 | 2.640625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing_objects3.c :+: :+: :+: ... | true |