language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
#include "channel.h" #include "stdio.h" #include "string.h" #include "stdlib.h" void ChannelInit(channel* c, int size, int elemSize) { c->size = size; c->elemSize = elemSize; if (!size) c->unbInfo = malloc(elemSize); else { c->bInfo = malloc(sizeof(queue)); QueueNew(c->bInfo, elemSize, ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_tab_print_one_elmnt.c :+: :+: :+: ...
C
#ifndef TOKEN_H #define TOKEN_H typedef union token_value { int number; char operater; }token_value; typedef enum token_type { open_bracket, close_bracket, number, operater, neutral } token_type; typedef struct token { token_type type; token_value value; } token; typedef enum state { success, error, division_by_zer...
C
//ת #include<stdio.h> int main() {int a,b,c; printf("Enter a date(mm/dd/yyyy):",a,b,c); scanf("%d/%d/%d",&a,&b,&c); printf("You entered the date:%d %d %d",c,a,b); return 0; }
C
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward d...
C
#include <stdlib.h> #include <stdio.h> void print(int n, int *p) { int i; for(i=0; i<n; i++) { printf("%d ", p[i]); } printf("\n"); } int LinearSearch(int n, int *p, int value) { int i; for(i=0; i< n; i++) { printf("%d: %d\n",i, p[i] ); if(p[i] == value) { return i; // 找到: 傳回資料位置 } } return -1; // 找不到: 回...
C
#include "flowsensor.h" #include "timerInterrupt.h" #include "heatingSys.h" #include "eeprom_calib.h" volatile uint16_t overflows=0; uint16_t freq=0; float waterConsumption =0; float calcflow =0; const uint8_t maxWaterConsumption = 200; // Liter uint8_t ErrorCodes=0; uint8_t resetTriesFlag=0; flowsensor2dtable_t l...
C
#include <stdarg.h> #include <stdio.h> enum drink { MUDSLIDE, FUZZY_NAVEL, MONKEY_GLAND, ZOMBIE }; //in C ellpise after argument means the function should expect variable # of args void print_ints(int args, ...) { //this stores extra arguments passed to your function va_list ap; /*This say...
C
#include<stdio.h> int main() { int a,b,s; scanf("%d%d\n",&a,&b); s=a+b; printf("%d\n",s); }
C
/* * (C) Iain Fraser - GPLv3 * Util functions that suprisingly are not part of std C. */ #ifndef _MATH_UTIL_H_ #define _MATH_UTIL_H_ #define max(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__ (b) _b = (b); \ _a > _b ? _a : _b; }) #define min(a,b) \ ({ __typeof__ (a) _a = (a); \ __typeof__...
C
/* *covert from decimal to other base */ #include <stdio.h> #include <stdlib.h> int main() { int stop=0; while (stop!=1) { int inputNumber=0; while(inputNumber<=0) { printf("enter a positive integer number: "); scanf("%d",&inputNumber); } ...
C
#include<stdio.h> int main() { int a,b,c,d,i=0,j=0,k=0; scanf("%d%d%d",&a,&b,&c); int arr[3]={a,b,c}; for(i=0;i<3;i++){ for(j=i+1;j<3;j++){ if(arr[i]>arr[j]) { d=arr[i]; arr[i]=arr[j]; arr[j]=d; } } } for(k=0;k<3;k++){ printf("%d\n",arr[k]...
C
/** * @file * @brief * * @date 03.12.12 * @author Anton Bulychev */ #include <hal/mmu.h> mmu_pgd_t *context_table[0x100] __attribute__((aligned(MMU_PAGE_SIZE))); int ctx_counter = 0; mmu_ctx_t mmu_create_context(mmu_pgd_t *pgd) { mmu_ctx_t ctx = (mmu_ctx_t) (++ctx_counter); mmu_set_ptd_entry(&context_table[...
C
#include "minishell.h" size_t tailledest(char *); void redir(char* mot[]){ int i,tmp; size_t reste; short separ; char *signe, *dest, *destcut, *temp; separ=0; for(i=0;mot[i] != NULL;i++){ signe=strstr(mot[i],"<"); //cas "<" if(signe!=NULL){ if(strlen(signe)==1){ //"<" et le...
C
#pragma once #include "model.h" #include "factor.h" struct Graph{ // G[i][j] = bitmask(3) -> [b2 b1 b0] // b0 = transition edge // b1 = skip edge // b2 = pair skip edge vector<vector<int> > G; int n; // key = bitmask(n) -> [bn-1 bn-2 ... b1 b0] // (bi==1) => ith node is present map<int, Factor> factors; voi...
C
#ifndef FILEMANIPULATOR_H_INCLUDED #define FILEMANIPULATOR_H_INCLUDED #include <stdio.h> #include <string.h> #include <malloc.h> #define YOGA_SEEK_SET 0 #define YOGA_SEEK_CUR 1 int count_char_max(FILE* t_fp) { fpos_t pos; int count_char=0; char char_scan; fgetpos(t_fp,&pos); fseek(t_fp,0,SE...
C
// // Created by James on 27/11/2020. // // OPEN FILES // FILE *fd = fopen("wombat.txt", "r"); // stdio.h int open(const char *path, int flags, mode_t mode);// POSIX // Returns a positive int of file descriptor, -1 if error // CREATE FILES // int creat(const char *pathname, mode_t mode); // CLOSE FILES // int close...
C
/* (a) Write a program that reads a message, then prints the reversal of the * message: * * Enter a message: Don't get mad, get even. * Reversal is: .neve teg ,dam teg t'noD * * Hint: Read the message one character at a time (using getchar) and store the * characters in an array. Stop reading when the array is f...
C
#define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> //int main() //{ // int a = 0x11223344; // int* p = &a; // *p = 0; // return 0; //} // //int* test() //{ // static int a = 10; // return &a; //} //int main() //{ // int* p = test(); // printf("hehe\n"); // printf("%d", *p); // return 0; //} //int main() //{ // i...
C
#include<stdio.h> #include<stdlib.h> #include<string.h> //#include<algorithm> int a[1000006]={0},b[1000006]={0},c[1000006]={0}; char arr[1000006]; struct node { long long int p; long long int q; }s[1000006]; int compare(const void*a,const void*b) { struct node* x=(struct node*)a; struct node* y=(struct node*)...
C
#include <assert.h> #include <stdio.h> #include <string.h> #include "sv/token.h" void scan(char* sToken) { sv_token_state_t state; memset(&state, 0, sizeof(sv_token_state_t)); state.input = sToken; state.length = strlen(sToken); state.pos.line = 1; ...
C
#include <stdio.h> #include <stdlib.h> #include "Lib.h" int getNumberFromUser() { int number_from_user; //0x00: 12 printf("Pls enter a interger number!\n"); scanf("%d", &number_from_user); return number_from_user; // return 12; } float meanVector(Vector *vec) { float sum = 0.0f; for (unsig...
C
#include <stdio.h> #include "appconfigscanner.h" #include <stdlib.h> #include<string.h> #include "structs.h" extern yylex(); extern int yylineno; extern char* yytext; char *names[]={ "GRID_DIM_x", "GRID_DIM_y", "GRID_DIM_z", "BLOCK_DIM_x", "BLOCK_DIM_y", "BLOCK_DIM_z", "INTEGER", }; void p...
C
//ȡһеżλλֱС #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> void print_Binary_Sequence(int num) { int count = 0; int i = 0; int arr[32] = { 0 }; while (num) { arr[i] = num % 2; count++; i++; num /= 2; } printf("żУ"); for (i = count; i >= 0; i -= 2) { printf("%d ", arr[i]); } printf("\n"); pri...
C
/* accept file name from user and read data of the file $ gcc readfile.c -o myexe $ ./myexe mydemo.txt data will read from "mydemo.txt" file depends on given len which is third parameter of prototype */ //reading file #include<stdio.h> #include<unistd.h> #include<fcntl.h> int main(int argc, char *argv[]) { i...
C
#include <stdio.h> int main() { int a[100],j,i,k,t; for(i=0;i<100;i++) scanf("%d",&a[i]); printf("\n"); for(i=0;i<99;i++) { for(j=i+1;j<100-i;j++) { if(a[i]>a[j]) {t=a[i]; a[i]=a[j]; a[j]=t;} } }printf("the sort number is\n"); ...
C
#include <stdlib.h> #include <stdio.h> void itob(int n, char s[], int b); void reverse(char s[]); int main(void) { char buffer[10]; int i; for ( i = 2; i <= 20; ++i ) { itob(255, buffer, i); printf("Decimal 255 in base %-2d : %s\n", i, buffer); } return 0; } /* itob: convert n to charecters in s - b...
C
#include<stdio.h> int main() { int a,b,c,d,e; scanf("%d",&a); b=a%10; c=a/10%10; d=a/100; e=b*100+c*10+d*1; printf("%d",e); return 0; }
C
// poj 1007 #include <stdio.h> #define M (102) #define N (102) typedef struct a_s { int i; int v; char s[M]; } a_t; int partition(a_t a[], int left, int right) { a_t pivot = a[left]; int j = left; int i = left + 1; // 2.1 以最左边的值p为基准 // 2.2 变量j初始化为最左边的位置 // 2.3 从左到右对数组进行遍历,当遇到一个值小于p的元素,则对...
C
#include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <assert.h> #include <limits.h> #include <stdbool.h> int main() { int x1; int v1; int x2; int v2; scanf("%i %i %i %i", &x1, &v1, &x2, &v2); int result_size; if((x1<x2) && (v1<v2)) printf("NO")...
C
//Explore cmath library #include <stdio.h> #include <math.h> int main (){ double d = 2.18; double e = 3.14; printf("double d = %.2f\n",d); printf("cos(d) = %.4f\n",cos(d)); printf("exp(d) = %.4f\n",exp(d)); printf("log(d) = %.4f\n",log(d)); printf("double e = %.2f\n",e); printf("pow(d,e) = %.4f\n",pow(d,e))...
C
/* * drawCockpit * cockpitImage * drawControlPanel * drawPoint * drawBar */ // pos telecamera Point3 pos_present=g_camera.getPos(), pos_past=g_camera.getPos(); // variabile che tiene conto del tempo clock_t precClock, precClock1=clock(); char msgShoot[1024]; void cockpitImage(); void drawControlPanel(); void...
C
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *link; }; struct node *start = NULL; void insert(int el) { struct node *newNode = malloc(sizeof(struct node)); newNode->data = el; newNode->link = NULL; if (!start) { start = newNode; return; } struct node *tempNode...
C
// // id_checking.c // // // Created by Juan García on 1/24/19. // #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define PROGRAM_FILE "fz_function.cl" #define KERNEL_NAME_FUNC "fz_function" #define Gx 256 #define Gy 256 #define Lx 16 #define Ly 16 #define N_WORK_ITEMS 64; #ifdef __...
C
// Exercise 3-1. // Our binary search makes two tests inside the loop, when one would suffice // (at the price of more tests outside.) Write a version with only one test // inside the loop and measure the difference in run-time. #include <stdio.h> int main() { fprintf(stderr, "not yet done\n"); return 1; }
C
/* * FIT VUT - PDS PROJECT 2012/2013 - LONGEST PREFIX MATCH * (c) Ondrej Fibich <xfibic01@stud.fit.vutbr.cz> */ #ifndef PREFIX_TREE_MATCH_H #define PREFIX_TREE_MATCH_H #include <stdlib.h> #include <stdint.h> /* * Tree for storing prefixes and searching for longest match on stored prefixes. */ /** * No...
C
#include <stdio.h> #include <stdlib.h> /* A binary tree node has data, pointer to left child and a pointer to right child */ struct node { int data; struct node* left; struct node* right; }; int max(int a,int b) { if(a>b) return a; else return b; } int depth(struct node *root) { if(!root) retu...
C
#include <stdio.h> #include <memory.h> #define maxn 10000000 #define maxp 1000000 char mk[maxn] ; int prime[maxp] , pnum ; void GenPrime ( int n ){ int i,j,k; pnum = 0; memset(mk, 0, n+1); for(i=2,k=4; i<=n; i++, k+=i+i-1){ if(!mk[i]){ prime[pnum++] = i; if(k<=n) for(j=i+i; j<...
C
#include "Instruction.h" /* isInstruction: this methods gets a Line from declerationCmd. Line stores the data from assembly row. its read the information from Line: L.label,L.cmd and L.data and set it in tmpCmd. tmpCmd represents an assembly insruction with operands. returns False by eror, other wise return...
C
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <float.h> #include "cchess.h" #include "ai.h" #include "gameState.h" #include "valid.h" #include "piece.h" #include "linkedList.h" #include "move.h" // Function for evaluating a game to determine who is winning // Positive number = current turn winn...
C
#include "ft_corewar.h" #include "libft.h" #include <fcntl.h> static int buff_int_from_chars(int32_t fd) { char buff[4]; int32_t r; char *rr; read(fd, buff, 4); rr = (char *)&r; rr += 3; *rr-- = *buff; *rr-- = *(buff + 1); *rr-- = *(buff + 2); *rr = *(buff + 3); return (r); } static void champ_error(t_v...
C
#include "breadthfirstsearch.h" BreadthFirstSearch::BreadthFirstSearch() { } QList<StateSpace *> *BreadthFirstSearch::search(StateSpace *startState) { Node *startNode = new Node(startState, nullptr); QList<Node*> *explored = new QList<Node*>(); QQueue<Node*> *frontier = new QQueue<Node*>(); Node *cur...
C
#include "joy.h" #include "adc.h" #include "math.h" #include "settings.h" int x; int y; int z = 0; int xmin = 0; int xmean = 127; int xmax = 255; int ymin = 0; int ymean = 127; int ymax = 255; void joy_init(){ clear_bit(DDRB,PB2); //Set joystick button pin to input set_bit(PORTB,PB2); //Set the internal pull-up ...
C
#include <stdio.h> #include<string.h> #include <time.h> #include<stdlib.h> #include "acbe.h" #include <sodium.h> #include <pbc/pbc_test.h> #define NUMTEST 100 extern pairing_t pairing; extern Param param; extern element_t MK; extern Users users[MAX_USER]; void random_set(Set *S, int len) { S->len = len; sran...
C
#ifndef _SVECTOR2_H #define _SVECTOR2_H //==================================================================================================== // Constants //==================================================================================================== static const float kPI = 3.1415926535f; static con...
C
/** * \file debug.h * \brief Debugging macros. * \author k.edeline * \version 0.1 */ #ifndef DEBUG_H #define DEBUG_H #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ /** * \def UNUSED * \brief Unused var macro. */ #ifdef UNUSED #elif defined(__GNUC__) # define UNUSED(x) UNUSED_ ## x __attr...
C
#include "binary_trees.h" #include <stdio.h> /** * binary_tree_insert_left - inserts a node as the left-child of another node * @parent: parent node * @value: value for the new node * Return: the new node */ binary_tree_t *binary_tree_insert_left(binary_tree_t *parent, int value) { binary_tree_t *new; if (parent == ...
C
#include <stdlib.h> #include <string.h> #include <sys/param.h> void realpath_ (char *filename, char *pathname) { #ifdef LINUX char resolvedname[PATH_MAX]; #else char resolvedname[MAXPATHLEN]; #endif if (realpath(filename,resolvedname)==NULL) { perror(filename); exit(-1); } strcpy(pathname...
C
#include "BSP_OTA.h" uint8 OTA_RxBuf[OTA_RX_LEN] __attribute__ ((at(0X20001000))); //ջ,OTA_RX_LENֽ,ʼַΪ0X20001000. struct OTA_struct OTA; uint16 Usart_Rx_Cnt, oldCount, AppLenth; iapfun jump2app; /** * @brief תӦó * @param appxaddr:ûʼַ. * @retval None */ static void Iap_Load_App(uint32 Addr) { if(((...
C
#include <stdio.h> int main () { char test[100] = "word1 word2 , word3"; char a[15], b[15]; char res[15]; //sscanf(test, "%s%[^,]%s", res, a, b); //sscanf(test, "%s%s%s", res, a, b); sscanf(test, "%s %[^ ] , %s", res, a, b); //sscanf(test, "%s%[^,], %s", res, a, b); //ssca...
C
// Microsoft Public License (MS-PL) - Copyright (C) Shawn Rakowski // This file is subject to the terms and conditions defined in // file 'LICENSE', which is part of this source code package. #include <assert.h> #include <stdlib.h> #include "util.h" #include "engine.h" #define NUM_CHIP_SLOTS 16 typedef struct pixelV...
C
#include <stdio.h> #include <string.h> #include <unistd.h> #define LENGTH 64 /* Output: Writing string to pipe in parent: Some text String read from pipe by child: Some text */ int main() { int p[2]; pipe(p); if (fork() == 0) { char input[LENGTH] = ""; read(p[0], input, LENGTH); printf("String read ...
C
#include <stdio.h> #include <string.h> #define TAMFRASE 80 #define TAMPAL 15 int func(char frase[], char palavra[], int tamf, int tamp); void main() { char f[TAMFRASE], p[TAMPAL]; printf("Indique frase: "); gets(f); printf("Indique palavra: "); gets(p); if(func(f,p,TAMFRASE,TAMPAL)) printf("...
C
#include <gmp.h> #include <stdint.h> #include <stdio.h> #include <string.h> #include <time.h> #include "libqform/qform_group.h" #include "libqform/tests/sanity_qform.h" #include "liboptarith/group_pow.h" #include "liboptarith/math_mpz.h" #define iterations 10000 #define groups 100 #define min_bits 16 #define max_bit...
C
/* * Make sure that scandir function works OK. * * Copyright (C) 1998-2019 Toni Ronkko * This file is part of dirent. Dirent may be freely distributed * under the MIT license. For all details and documentation, see * https://github.com/tronkko/dirent */ /* Silence warning about fopen being insecure (MS Visual...
C
// Written by: someone too ashamed to actually put their name here // Determines if the user is in highschool or not. #include <stdio.h> #define FIRST_HIGHSCHOOL_YEAR 7 #define LAST_HIGHSCHOOL_YEAR 12 int main(void) { printf("What year are you in? "); int year = 0; scanf("%d", &year); if (...
C
/* ** EPITECH PROJECT, 2018 ** left ** File description: ** left.c */ #include "server.h" void get_left(player_t *tmp, int fd) { if (tmp->fd == fd) { tmp->axe = ((tmp->axe - 2 + 4) % 4) + 1; dprintf(fd, "ok\n"); } } void left(server_t *srv, int fd, __attribute__((unused)) char *arg) { int i; player_t *tmp; ...
C
/* Adel Danandeh Graph.h is the header file for Graph implementation. All the function protypes which will do certain operations are listed in this file. */ #include <stdio.h> #include <stdlib.h> #include"List.h" #define UNDEF -1 #define NIL 0 #define WHITE 1 #define GRAY 2 #define BLACK 3 typedef struct GraphObj* ...
C
// Eric Moss // Advent of code 2019 // Day 5 part 1 // Run an intcode computer through a diagnostic program // input: <program> #include <stdio.h> #include <stdlib.h> #include <string.h> #define PROGRAM_LENGTH 256 #define OPCODE_SIZE 4 // returns a pointer to an int array of size OPCODE_SIZE // array[0] is the opco...
C
#include"rttimer.h" #include<string.h> #ifdef _WIN32 # include<Windows.h> #else # define UNIX_CLOCK_GETTIME # include<unistd.h> # include<time.h> # include<errno.h> #endif // _WIN32 //============================================================================= // Func: _get_raw_time // Desc: Get the raw time ...
C
#include <stdio.h> /* main() { int x, z; A: printf("unesite broj:"); scanf( "%d", &x ); while (x > 0) { z = z + x; goto A; } printf("%d", z); return 0; } */ main() { int x = 1, z = 0; while (x > 0) { printf("unesite broj:"); scanf( "%d", &x ); z = z + x; } z = z - x; printf("%d", z);...
C
#include<stdio.h> #include<stdlib.h> #include<errno.h> #include<systemd/sd-bus.h> static int checker(sd_bus_message *m, void * , sd_bus_error *); static int exiting(sd_bus_message *m, void * , sd_bus_error *); //static int method_multiply(sd_bus_message *m, void *userdata, sd_bus_error *ret_error); static int method_...
C
// ______________________________________________________________ // // Program: tfreq // Author : Timothy A.V. Teatro <timothy.teatro@uoit.ca> // Date : July 2008 // // Description: // This code reads in a set of atomic trajectories in .pos // format and computes the velocity autocorrelation function // (VAC). The VAC...
C
#include <stdio.h> int main(){ int cod1, cod2, quant1, quant2; double valunit1, valunit2, totpagar, valtot1, valtot2; scanf("%i",&cod1); scanf("%i",&quant1); scanf("%lf",&valunit1); scanf("%i",&cod2); scanf("%i",&quant2); scanf("%lf",&valunit2); valtot1=valuni...
C
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #include <sys/wait.h> #include <signal.h> #define PORT "3490" // the port users wil be connecting to...
C
#include<stdio.h> #include<string.h> #include<stdlib.h> char* decToHexa(int n) { // char array to store hexadecimal number char hexaDeciNum[100]; // counter for hexadecimal number array int i = 0; while(n!=0) { // temporary variable to store remainder int t...
C
// character into integer conversion using atoi(): #include<stdio.h> int atoi(char x[]) { int n = 0,i; for(i=0;x[i]>='0' && x[i]<='9';++i) n = n * 10 + (x[i]-'0'); return n; } void main() { char a[12]; int i; printf("Enter the string for 'A':\n"); gets(a); ...
C
#include "clib.h" #include "print.h" #include "intr.h" void mem_cpy(void *src, void *dst, uint64 size) { char *cSrc = (char *) src; char *cDst = (char *) dst; while (size--) { *(cDst++) = *(cSrc++); } } void mem_set(void *src, uint8 val, uint64 size) { while (size--) { *(ui...
C
#include <limits.h> #include <stdio.h> int main() { printf("Valeur de NAME_MAX: %i\n", NAME_MAX); printf("Valeur de PATH_MAX: %i\n",PATH_MAX ); return 0; }
C
#include<stdio.h> #include<conio.h> typedef struct { char nome[50]; char endereco[80]; char profissao[50]; char nascimento [10]; int conta; float valor_conta; }reg; reg* inserir (reg *g, int tam){ int i; for(i = 0; i<tam; i++){ scanf("%d", ...
C
/************************************************ * filename: Ngoc_Son_Nguyen_M5_Programming_4.c * Exercise: Module 5, Programming, Exercise 4 * Name: Ngoc Son Nguyen * Date Created: May 06, 2019 * * Description: This program uses a 10-element integer array and prompts the user for 10 integer values to pop...
C
#include<sys/types.h> #include<unistd.h> #include<sys/stat.h> #include<stdio.h> #include<fcntl.h> #include<string.h> int main() { int fd,i; char msg[101]; fd= open("/dev/chardev0",O_RDWR,S_IRUSR|S_IWUSR); if(fd!=-1) { while(1) { for(i=0;i<101;i++) //初始化 ...
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #define COMPARE(x,y) (((x)>(y))? 1 : ((x)==(y))? 0 : -1 ) // 이진탐색 int binsearch(int left, int right, int searchnum, int S[]); int main() { int S[9] = {112,4,7,425,37,12,99,101,47 }; int result; result = binsearch(0, 8, 4, S); printf("%d", result); return...
C
#include<stdio.h> void main() { int m,n,c; printf("enter the nnumber"); scanf("%d",&m); printf("enter the nnumber"); scanf("%d",&n); c=m*n; if(c/2) { printf("it is even number"); } else { printf("it is odd number"); } }
C
/* C Preprocesor Source Code | Preprocesor | Pre-procesed program | Compiler | Binary Executable File Include Files #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include "stdio.h" #include "\dir\files\headers\my_file.h" Macros (Symbolic names) #define SIZE 10 ...
C
/* SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 The WinMain function -- calls your program's main() function */ #include <stdio.h> #include <stdlib.h> #define WIN32_LEAN_AND_MEAN #include <windows.h> #ifdef _WIN32_WCE # define DIR_SEPERATOR TEXT("\\") # undef _getcwd # define _getcwd(str...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_display.c :+: :+: :+: ...
C
#include <stdio.h> #include <stdlib.h> typedef struct node * link; struct node { char item; struct node *l, *r; }; link root = NULL; link make_node(char item) //创建节点 { link p; p = malloc(sizeof(*p)); p->item = item; p->l = NULL; p->r = NULL; return p; } void traverse(link t) //遍历 { if (t == NULL) { ...
C
/************************************************ * creator: vingc zhang * time: 2017.03.27 *************************************************/ #include <stdio.h> #include <stdlib.h> #include <string.h> /* ref: http://www.geeksforgeeks.org/count-triplets-with-sum-smaller-that-a-given-value/ Count triplets with sum smal...
C
/******************************************************************************* * File Name: Ana.c * Version 2.0 * * Description: * This file contains API to enable firmware control of a Pins component. * * Note: * ******************************************************************************** * Copyright 2008-201...
C
/* Yanling Wang Fall 2018 */ #ifndef LIST_H #define LIST_H typedef struct listNode{ char host[MAXLINE]; char port[MAXLINE]; char query[MAXLINE]; char *memory; int memsize; struct listNode *next; struct listNode *prev; } listNode; /*typedef struct listNode { int value; struct listNode *...
C
/************************************************************************************* * Programmer: Kristin Onorati * Class: CPTS 122, Summer 2013 * Programming Assignment: 1 * Date: June 9th, 2013 * Description: Gets a string from the user and applies a Caesar shift cipher based on a * shift determined by the user....
C
#include <stdio.h> // #include <stdlib.h> #include <math.h> #include "random.h" static const double two_pi = 2.0 * 3.14159265358979323846; // static const double sqrt_2 = 1.41421356237309504880; // Returns a random number in [min, max]. inline Number uniform_random(void *rng, Number min, Number max) { return (max...
C
/* * File: iMapaDeBits.h * Author: Monty * * Created on 19 de marzo de 2016, 01:10 */ #ifndef IMAPADEBITS_H #define IMAPADEBITS_H #include "../../Bloque/Headers/iBloque.h" typedef class iMapaDeBits { public: // Devuelve la referencia al bloque interno virtual const iBloquePtr Leer() = 0;...
C
/* * Copyright (c) 2020 Lucas Müller * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publis...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N_TOKEN_HASH 73176001 typedef struct token{ char* content; int len; } token; int trans(char c); unsigned int hash(token* c, int base); unsigned int weirdhash(token* c, int base); int cmpfunc(const void* a, const void* b) {return (*(unsigned i...
C
/* $Id: sig_block.c 4723 2009-11-16 18:57:09Z kobus $ */ #include "l/l_incl.h" static TRAP_FN_RETURN_TYPE trap_fn_0(int); static TRAP_FN_RETURN_TYPE trap_fn_1(int); static TRAP_FN_RETURN_TYPE trap_fn_2(int); static TRAP_FN_RETURN_TYPE trap_fn_3(int); static TRAP_FN_RETURN_TYPE trap_fn_4(int); static TRAP_FN...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "liczbyRzymskie.h" char *znaki[] ={ "M\0", "CM\0", "D\0", "CD\0", "C\0", "XC\0", "L\0", "XL\0", "X\0", "IX\0", "V\0", "IV\0", "I\0" }; int wartosci[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, ...
C
#include "headers.h" void IO(char **comm) { int append=0,greater=0,less=0; int i=0; char inp[1024]; char out[1024]; int fl=0; int pehla,doosra; for(i=0;comm[i]!=NULL;i++) { if(!strcmp(comm[i],">")) {greater=1; fl=0; comm[i]=NULL; ...
C
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <math.h> #define N 100 #define LINE "************************************************" void transform(double [], double [], int, double (*) (double)); void display(double [], int); double add_one(double); double squared(double); int main(void) { s...
C
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include "DekoFunkcijos.h" void SukurtiDeka(DekoRodykles *zymiuData) { Dekas *naujas = (Dekas*)malloc(1*sizeof(Dekas)); zymiuData->pradinis = naujas; if (naujas == NULL) return; naujas->next = NULL; naujas->prev = NULL; zymiuData->k...
C
#include<stdio.h> #include<stdlib.h> #include<conio.h> typedef struct node{ char harf; int frekans; struct node *left,*right,*next; }NODE; NODE* add_node(NODE*,char,int); void insert_after(NODE **,NODE *); void delete_node(char*); void print_list(NODE*); void insertion_sort(NODE**); NODE* huffman(NODE*);...
C
#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand((unsigned)time()); int n =rand()&1000; n = rand() & 1000; // deuxime initialisation de rand car on n'a pas beaucoup de variations // Il est difficile, en se basant sur le temps, d'obtenir des nombres vraiment alatoires int...
C
/* https://raw.githubusercontent.com/adafruit/Adafruit_SleepyDog/master/utility/WatchdogSAMD.cpp */ #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <stdbool.h> #include <string.h> #include "samd20.h" extern uint8_t wdt_wakeup; void wdt_reset() { // Write the watchdog clear key value (0xA5) t...
C
//백준 2750번 문제 //선택 정렬 #include<stdio.h> #include<stdlib.h> void swap(int*, int*); int main() { int n=5, min; scanf("%d", &n); int* a = malloc(n*sizeof(int)); for(int i=0; i<n; i++) { scanf("%d", &a[i]); } //start sorting for(int i=0; i<n-1; i++) { min = i; ...
C
#include <stdio.h> #include <stdlib.h> void Verifica(int N); int main() { int valor; printf("Digite um valor: "); scanf("%s", &valor); Verifica(valor); system("pause>>null"); return 0; } void Verifica(int N) { if(N%2==0) printf("Valor par"); else printf("Valor impar"); ...
C
#include "LCD1602.h" #include "delay.h" #include "string.h" void LCD1602_Configuration(void) { delay_init(); LCD1602_RCC_Configuration(); LCD1602_GPIO_Configuration(); delay_ms(400); LCD1602_WriteCommand(0x38); LCD1602_WriteCommand(0x0c); LCD1602_WriteCommand(0x06); LCD1602_WriteCommand(0x01); } void LCD1602...
C
#ifndef HT_H #define HT_H /***************************************************************************** * * File: ht.h * Author: Alex Stivala * Created: April 2009 * * Declarations for separate chaining hash table. * * * $Id: ht.h 4556 2013-01-13 02:20:29Z astivala $ * ********************************...
C
#include <stdlib.h> #include <stdio.h> /* for fprintf(), stderr, BUFSIZ */ #include <errno.h> /* declare errno */ #include <fcntl.h> /* for flags for open() */ #include <string.h> /* declare strerror() */ #include <unistd.h> /* for ssize_t */ #include <sys/types.h> #include <sys/stat.h> /* for mode_t */ // ./ge...
C
/** * @file server.c * @brief Server side of a local client-server system, implemented using named pipes * @version 0.1 * @date 2021-04-22 * * @copyright Copyright (c) 2021 * */ #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <time.h> #include <string.h> #include <ctype.h> #include <pthr...