language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
#include <stdio.h> void funcion_uno(int *arreglo,int size_arr,int size_arr_pointeur); void funcion_dos(int *arreglo,int size_arr,int size_arr_pointeur); main () { int arreglo[6]={1,23,56,8,98,45}; int arreglo_multi[3][3]={{1,2,52},{3,56,42},{75,8,14}}; printf("essai_function_uno_arreglo-----------...
C
#include<stdio.h> #define p(n) printf("n"); void siftDown(int arr[], int root, int bottom) { int maxChild = root * 2 + 1; // Find the biggest child if(maxChild < bottom) { int otherChild = maxChild + 1; // Reversed for stability maxChild = (arr[otherChild] > arr[maxChild])?otherChild:maxChild; } ...
C
#include "holberton.h" /** * print_triangle - prints a triangle of pound signs * @size: size of the triangle * Return: none **/ void print_triangle(int size) { int i, x, s; if (size <= 0) { _putchar('\n'); } for (i = 0; i < size; i++) { for (x = 0; x < size; x++) { s = size - i - 1; if (x < s) ...
C
#include<stdio.h> #include<string.h> #define N 12 int board[N][N]; int gx[] = /*{1, -1, 0, 0}*/{-1, 1, 0, 0}; int gy[] = /*{0, 0, 1, -1}*/{0, 0, -1, 1}; int hcx[] = /*{2, 2, 1, 1, -1, -1, -2, -2}*/{-2, -1, -2, -1 , 1, 2, 1, 2}; int hcy[] = /*{-1, 1, -2, 2, -2, 2, -1, 1}*/{-1, -2, 1, 2, -2, -1, 2, 1}; int hncx[] = /*{1,...
C
#include <stdio.h> #include "maphash.h" int main(void) { hashTableObj* hashTable = msCreateHashTable(); //initHashTable(hashTable); if (msInsertHashTable(hashTable, "key1", "value") == NULL) { printf("Could not insert"); } else { printf("Value added"); } const char* key = ...
C
#include <stdio.h> #include <string.h> const int arraySize_Dim1 = 4; const int arraySize_Dim2 = 5; char output_str[300]; char tmp_str[5]; void printarray(int array[][arraySize_Dim2], int Dim1, int Dim2) { int i; int j; for( j = 0; j < Dim1; j++ ) { for( i = 0; i < Dim2; i ++) { prin...
C
#include <stdio.h> int main() { int i=1,n,ch; float avg,sum=0; scanf("%d",&n); while(i<=n){ scanf("%d",&ch); sum=sum+ch; i++; } printf("\nSum: %.0f",sum); avg=sum/n; printf("\nAvg: %.2f",avg); return 0; }
C
#include "sqr.h" int UnitTest (){ struct coeffs Data[] = { //! {1, 5, -6, NAN, NAN, 0, 2, 1 , -6}, {0.00009, 5, 18, NAN, NAN, 0, 1, -3.6 , NAN}, {1, 0, -2, NAN, NAN, 0, 2, sqrt(2), -sqrt(2)}, {2, -4, -30, NAN, NAN, 0, 2, 5, -3}, {0, 0, 1, NAN, NAN, 0, 0, NAN, -3}, {0, 0, 0, 0, 0, 0, INF_ROOTS, 0, ...
C
#include "communication.h" #include "usbd_cdc_if.h" #include <string.h> rxState_t curRxState = RX_IDLE; void cdc_receiveData(uint8_t* buf, uint32_t len) { switch (curRxState) { case RX_IDLE: { // Receive first chunk including length bytes if (len < 2) { // Not enou...
C
#include <kernel/uart.h> void putc(unsigned char c) { uart_putc(c); } unsigned char getc() { return uart_getc(); } void puts(const char * str) { uart_puts(str); }
C
#include <stdio.h> #include <string.h> int main () { int n, letras[26], soma, aux; char frase[1001]; for (scanf("%i", &n); n>0; n--) { for (aux=0; aux<26; aux++) letras[aux]=0; soma=0; fflush(stdin); fgets(frase, 1001, stdin); for (aux=0; aux<strlen(frase)...
C
#include <sys/wait.h> int main(int argc,char *argv[]) { int status; pid_t pid=fork(); if (pid == 0) return 3; else{ printf('child pid: %d',pid); pid=fork(); if (pid==0){ exit(7); } else{ printf("child pid: %d",pid); wait(&status); if (WIFEXITED(status)) printf("child send :%d",WEXITSTA...
C
/* ** del_all_by_data.c for in /home/fourni_s/UNIX/Presets/lib/list/sources ** ** Made by sonny fournier ** Login <fourni_s@epitech.net> ** ** Started on Fri Feb 12 23:45:09 2016 sonny fournier ** Last update Sat Feb 13 01:04:11 2016 sonny fournier */ #include "list.h" void condition_of_del_all(t_node **del, t_...
C
#include "IO.h" //init void init(){ root = (struct user *)malloc(sizeof(struct user)); //init the root root->name = "root"; root->group = "root"; root->id = -1; root->next = NULL; // init capability_lists, group, user char* fileName[] = {"capability_lists", "group", "user"}; for(i...
C
#include <string.h> #include <stdio.h> #include <stdlib.h> #include "utn.h" #include "socios.h" //cambiar por nombre entidad #include "libro.h" #include "autor.h" #include "prestamos.h" int menuAutor(Autor* arrayAux, int len, int* idAux) { int opcion; //Autor arrayAux[len]; autor_Inicializar(arrayAux,le...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* prototype.c :+: :+: :+: ...
C
#include "headers.h" int main(void) { struct student class[MAX_STD]; int students; printf("Welcome to our program!!\n"); students = ask_for_data(class); if (students > 0) { print_some_space(); print_class(class, students); print_some_space(); compute_statistics(class, students); } printf(...
C
//wap to accept a number and exit if user entered a number 5 using do while loop. #include<stdio.h> int main() { int num; do { printf("Enter number\n"); scanf("%d", &num); printf("number = %d\n",num); } while (num != 5); return 0; }
C
#include<stdio.h> int main(void) { int number,position; printf("Enter a number: "); scanf("%d",&number); printf("Enter a position: "); scanf("%d",&position); int mask = (1 << position); int newNumber = number | mask; position += 3; int result = newNumber | (1<<position);...
C
#include<conio.h> #include<stdio.h> void main() { int i,num; clrscr(); printf("\n enter a num : "); scanf("%d",&num); for(i=1;i<=10;i++) printf("\n %d * %d = %d ",num,i,num*i); getch(); }
C
int ft_strindex(const char *str, const char c) { int i; i = 0; while (str[i] != '\0') { if (str[i] == c) return (i); i++; } return (-1); }
C
#include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <string.h> int ship[32780][260] = {0}; int count[32780] = {0}; int main(void){ int N, E; scanf("%d%d", &N, &E); int va, vb; for(int i = 0;i < E;i++){ scanf("%d%d", &va, &vb); ship[va][ count[va]+...
C
#include <stdio.h> int main() { int a = 1; printf(" 전위 연산자 수형후 : %d \n", --a); a = 1; printf("후위 연산자 수행 후: %d", a--); printf("최종 : %d \n", a); return 0; }
C
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <pthread.h> #define SIZE_OF_STRINGS_IN_LIST 80 typedef struct str_list { pthread_mutex_t node_mutex; int node_id; char string[SIZE_OF_STRINGS_IN_LIST]; struct str_list *previous; struct str_list *next; } String...
C
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <dirent.h> #include <limits.h> /** * kill processes which access descendants of given directory */ int is_number(const char *s) { size_t i, len = strlen(s); for (i = 0; i < len; i++) { if (!isdigit(s[i])) return 0; } return 1; } void kill...
C
// // Created by 赵明明 on 2019/11/18. // #include "x86.h" #include "font.h" #include "stdio.h" #include "string.h" static int is_digit(unsigned char ch) { return ch >= '0' && ch <= '9'; } static unsigned long long get_unsigned_int(va_list ap, int lflag) { if (lflag > 1) { return va_arg(ap, unsigned long...
C
#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { my_fact(4); printf(" "); return 0; } int my_fact(int num) { int val=1; for ( ;num>1;num--) { val=val*num; printf("%d\n",val); } return 0; }
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* free.c :+: :+: :+: ...
C
/* Maftuna Sharabbaeva U1510067 (002) This program SecondOne.c reads in an input line,then parses the input line into tokens, as well as apply execvp() to run the command. */ #include <stdio.h> //input/output functions #include <sys/types.h> // here include definition f...
C
/****************************************************************************** * * * file name: symbol_table.c * * author: Armando Miraglia *...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <unistd.h> #include <fcntl.h> #include <sys/epoll.h> #include <errno.h> #include <pthread.h> #include "gemtc_api.h" /* TODO: May have to change that */ #define MAXEVENTS 64 #define NO...
C
// Uncomment this to run a randomized encryption /* #include "encrypt-module.h" #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <time.h> #include <unistd.h> #include <ctype.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> FILE *input_file; FILE *output_file; i...
C
/** * @file drv_gpio.h * * Generic GPIO ioctl interface. */ #ifndef _DRV_GPIO_H #define _DRV_GPIO_H #include <sys/ioctl.h> /* * PX4FMUv2 GPIO numbers. * * There are no alternate functions on this board. */ # define GPIO_SERVO_1 (1<<0) /**< servo 1 output */ # define GPIO_SERVO_2 (1<<1) /**< servo 2 outpu...
C
#include <stdlib.h> #include <stdio.h> //Marilena Anghelopoulou ID:260530237 //COMP 206 Ass 4 // FindRecord opens the file and reads each record looking for matching record name. Return matching record in array record[]. Closes file. void FindRecord(char *filename,char *name,char record[]){ // Initialise variable...
C
#include <dan.h> #include <io.h> #include <unistd.h> #include <assert.h> #include <blas-lapack-dan.h> #include <iogeno.h> int main(int argc, char *argv[]) { int c, n, nc2, nvecs, i, j, k, v, rtn ; char *cov_file, *indiv_exclude_file, *outdir, outfile[500] ; double *s, *evals, *evecs ; FILE *fp ; bo...
C
/* ** my_getnbr.c for my_getnbr in /media/blinux/noboud_n/Librairie/sources ** ** Made by Nyrandone Noboud-Inpeng ** Login <noboud_n@epitech.net> ** ** Started on Mon Dec 22 00:08:21 2014 Nyrandone Noboud-Inpeng ** Last update Thu Mar 19 17:27:23 2015 Nyrandone Noboud-Inpeng */ #include "asm.h" int posneg(int *n...
C
#include <stdlib.h> #include <stdio.h> #include <limits.h> #include <errno.h> int main (int n_args, char **arg) { char *endptr = 0; errno = 0; long long number = strtoll (arg[1], &endptr, 10); if ((errno == ERANGE && (number == LLONG_MAX || number == LLONG_MIN)) || (errno != 0 && nu...
C
/* * $Id: data.c,v 1.29 2004/03/17 04:14:06 drewfish Exp $ * * Placed in the public domain by Drew Folta, 2002. Share and enjoy! * * See data.dev for implementation notes. * */ #include <config.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> #include <time.h> #include "data.h...
C
#ifndef JOGO_H_INCLUDED #define JOGO_H_INCLUDED #include <stdio.h> #include <conio.h> #include "console.h" typedef struct tipo_configuracoes{ int rastro; int borracha; int cor; } Configuracoes; typedef struct tipo_coordenadas{ int coluna; int linha; } Coordenadas; typedef struct tipo_tecla{ ...
C
#include <stdlib.h> #include <stdio.h> #include "../mtrx.c" #include "../mtrx_float.c" #include "../mtrx_int.c" void test1() { int dimension_1 = 2, dimension_2 = 2; float testIn_1[4] = {1.0f, 2.0f, 3.0f, 4.0f}; float testIn_2[4] = {4.0f, 3.0f, 2.0f, 1.0f}; float testOut[4] = {5.0f, 5.0f, 5.0f, 5.0f}; ...
C
/* scode-logl model < data */ const char *usage = "Usage: scode-logl [-z Z] model < data\n"; /* Computes the average log likelihood of the tuples in data based on the embeddings given in model output by scode. The model file has the format: i:token <tab> cnt <tab> vec1 <tab> vec2 ... Where i is the column of the t...
C
char* kth_word_in_mth_sentence_of_nth_paragraph(char**** document, int k, int m, int n) { return document[n-1][m-1][k-1]; } char** kth_sentence_in_mth_paragraph(char**** document, int k, int m) { return document[m-1][k-1]; } char*** kth_paragraph(char**** document, int k) { return document[k-1]; } cha...
C
#include <errno.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <sys/types.h> #include <stdio.h> #include <unistd.h> #include <dirent.h> #include "makeargv.h" /* The maximum amount of bytes for a file name */ #define MAX_FILE_NAME_SIZE 255 /* The maximum amount of bytes for each I/O operation *...
C
/********************************************************************************** * ADCʵ * PA0ΪADC1תͨת12λADֵӴ1 * ʵƽ̨NiRen_STM32mini * 汾 ST_v3.5 * ͨģ鿪Ŷ * http://nirenelec.blog.163.com * Ա http://nirenelec.taobao.com ******************************************************************************...
C
#include <stdio.h> int rickiter(int n,int t, int count, int indic); void rickq(int n, int t); int main() { int n,t; scanf("%d %d",&n,&t); rickq(n,t); return 0; } void rickq(int n, int t) { printf("%d", rickiter(n,t,0,0)); } int rickiter(int n,int t, int count, int indic) { if(count==t){ re...
C
#include <stdio.h> int main(void) { char *p = "Hello World!!!"; // ڿ ǹϴ ڰ ƴ ... while(*p != '\0') printf("%c", *p++); printf("\n"); return 0; }
C
#include <unistd.h> #include <stdio.h> #include <getopt.h> #include <sys/stat.h> #include <sys/types.h> #include <dirent.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <pwd.h> void List(char* path); void ListDir(char* path); void Print(char *path); int aflag,lflag, rflag; void GetKeys(int argc, ...
C
/** * Copyright (c) 2006-2011 Spotify Ltd * * 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, p...
C
/* ** EPITECH PROJECT, 2019 ** my_str_toword_array.c ** File description: ** 103cipher */ #include <stdlib.h> #include <unistd.h> #include "103cypher.h" int is_alpha_or_num(char c) { if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122) || (c >= 48 && c <= 57)) return (1); return (0); } int nb_word(char ...
C
#include <stdio.h> #include <conio.h> #include <string.h> int main() { int k, i, e, l, m; char list[k][64]; char *addr[k]; char **list1; char **list2; do { do { printf("Enter amount of strings(it should be bigger than 1 and less than 64)\n"); m = scanf(...
C
#include <stdio.h> #include <string.h> #include "statistic.h" void STATS_RESET(){ FILE* disk; disk = fopen("statistic.txt", "w"); fprintf(disk, "Reads: 0\nWrites: 0\nComparisons: 0\n"); fclose(disk); } void STATS_PRINT(){ FILE* stats; int read_amount, write_amount, comparisons_amount; char dummy[...
C
/* ------------------------------ * * File : @(#) vadd.c * Project : Lbam * Date : Oct/91 * Module : vadd ( Virtual address manager; implementation ) * Programmer : Dylan L. Hoffman / Franc. J. Ballesteros * * Comments : Provides virtual addressing through the Graph Memory * ...
C
#include<stdio.h> int main(int argc, char* argv[]){ int m = 0; int n = 0; while(scanf("%d", &m) != EOF) { scanf("%d", &n); int square_sum = 0; int cube_sum = 0; int s = 0; int g = 0; if (m<=n) { s = m; g = n; } else { s = n; g = m; } for (int i=s;...
C
/* * Lab 3 SOFE 3950U / CSCI 3020U: Operating Systems * * Copyright (C) 2015, 100493227, 100451291, 100523158, 100462413, 100522340 * All rights reserved. * */ #include "utility.h" #include <pthread.h> #include <stdio.h> #define RED "\x1b[0;31m" // 41m for background #define RESET "\x1b[0m" // our 9 by 9 sudok...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* show_alloc_mem.c :+: :+: :+: ...
C
#include <stdio.h> #include <stdlib.h> #define capacity 5 int queue[capacity],front=0,rear=0; void insert(){ if(capacity==rear){ printf(" queue is full\n" ); }else{ int x; printf("Enter a number:\n" ); scanf("%d",&x); queue[rear++]=x; } } void delete(){ if(front==rear){ printf("e...
C
// // stunted_rwv.c // saltunnel // #include "math.h" #include "stunted_rwv.h" #include "oops.h" #include <sys/uio.h> #define STUNTED_READ_N 512 #define STUNTED_WRITE_N 512 // Only read at most STUNTED_READ_N bytes at a time (for testing) int stunted_readv(int fd, struct iovec* vector, int count) { if(vector[0...
C
/* program to illustrate process creation via fork and exec */ #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <sys/file.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> char parent[15]; /* room for parents pid in ascii */ char *child[] = {"myname=john",...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_ls.c :+: :+: :+: ...
C
#include<stdio.h> int main() { int temp,flag,num; printf("\n enter the number:"); scanf("%d",&num); temp=num while(temp!=1) { if(temp2!=0) { flag=1; break; } if(flag==0) { printf("\n is power of 2,num"); } else if(flag==1) { printf("\n is power of not 2,num"); } return 0; } }
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #define true 1 #define false 0 /* PUC Minas - Ciencia da Computacao Nome: File Autor: Axell Brendow Matricula: 631822 Versao: 2.0 Data: 13/09/2018 */ // ----------------------- INICIO DA CLASSE FILE FILE *s...
C
#include <stdio.h> #include <stdlib.h> #include <conio.h> #include <string.h> int compare(char n[50], char n3[50]){ int c = 0; while (n[c] == n3[c]) { if (n[c] == '\0' || n3[c] == '\0') break; c++; } if (n[c] == '\0' && n3[c] == '\0') return 1; else return 0; ...
C
class Solution { public: vector<string> Permutation(string str) { vector<string> arr; set<string> ss; if (str.size() == 0) return arr; fun(str, ss, 0); set<string>::iterator it; for (it = ss.begin(); it != ss.end(); it++) arr.push_back(*it); ...
C
#include "stdlib.h" #include "stdio.h" #include "string.h" #define N 100 int derivation(int *polynomial, int *output, int length) { int ret = 0, i = 0, k = -1; if (NULL == polynomial || NULL == output) { ret = -1; printf("err polynomial\n"); return ret; } //length == 数字个数 ...
C
/********************************************************* * From C PROGRAMMING: A MODERN APPROACH, Second Edition * * By K. N. King * * Copyright (c) 2008, 1996 W. W. Norton & Company, Inc. * * All rights reserved. * * This program may be fr...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_itoa.c :+: :+: :+: ...
C
#include <errno.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <pwd.h> #include <stdlib.h> #include <sys/wait.h> #include <readline/history.h> #include <readline/readline.h> #include "alias.h" #include "error.h" #include "parser.h" #include "shell_builtins.h" #include "interprete...
C
#include <stdio.h> #include <stdlib.h> typedef struct arvore{ int info; struct arvore* dir; //ponteiro para subárvore à direita (dir) struct arvore* esq; //ponteiro para subárvore à esquerda (esq) } Arvore; /* Função que cria uma árvore */ Arvore* cria_arvore(){ return NULL; } /* Função que verifica se uma á...
C
// // Created by w1jtoo on 16.01.2020. // #include <stdio.h> #include "builtins.h" #include <stdbool.h> #include <string.h> #include <direct.h> ExecuteResult help(char **args) { printf( "+------------------------------------------------------+\n" "|----------------------------...
C
#include "tabpos.h" /* tabpos -- return true if col is a tab stop */ bool tabpos(int col, bool tabstops[MAXLINE]) { if (col > MAXLINE) { return true; } else { return tabstops[col]; } }
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_w_strdup.c :+: :+: :+: ...
C
#include <stdbool.h> enum {HT_MAX_CAPACITY=24}; // hashtable structures typedef struct hashtable { struct llist* container[HT_MAX_CAPACITY]; } hashtable; // linked list structures typedef struct llist { struct llnode* head; struct llnode* tail; } llist; typedef struct llnode { int val; struct llnode* next; ...
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <limits.h> #include <math.h> #include <ctype.h> #define MIN(a,b) ((a)>(b))?(b):(a) /** * Return an array of size *returnSize. * Note: The returned array must be malloced, assume caller calls free(). */ char** commonChars(char*...
C
//Name: Isaac DeMello //Date 2/4/15 //Group: Isaac Kyle Woojin #include<stdlib.h> #include<stdio.h> #include<time.h> main() { /* declaring variables required for input */ float F; float C; printf("Enter value of temperature conversion:", F ); scanf("%f", &F); /* Formula */ C = (F - 32.0) * (5.0/9.0); /* pri...
C
/* Escreva um programa em linguagem C que leia um número e exiba a sua tabuada numero = 5 5 x 0 = 0 5 x 1 = 5 5 x 2 = 10 ... 5 x 9 = 45 */ #include <stdio.h> int main(){ int numero; printf("Digite um número: "); scanf("%i", &numero); for(int contador =0; contador <=9; contador++){ int respost...
C
dynami_stack // // main.c // stackPrac // // Created by Vicky_Jha on 26/10/19. // Copyright © 2019 test. All rights reserved. // #include <stdio.h> #include <stdlib.h> //#define MAX 5; int top = -1; struct stack { int *A; int MAX_SIZE; int size; int *B; }; struct stack *pt; void newStack(int s...
C
#ifndef _TASK_H_ #define _TASK_H_ #include <stdint.h> #include <stddef.h> /*============================================================================= ** Type Definitions =============================================================================*/ /* Describes a single stack frame, as found at the top of...
C
/* * piperw - The correct way to open a pipe and fork a child process. */ #include<unistd.h> #include<sys/types.h> #include<sys/wait.h> #include<stdio.h> #include<stdlib.h> #include<fcntl.h> #include<limits.h> #define BUFSZ PIPE_BUF void err_quit(char *msg); int main(int argc,char *argv[]) { int fd[2]; int fdi...
C
#include <stdio.h> #include <fcntl.h> #include <sys/stat.h> int main() { char buf[20]; int fd; printf("Obrint pipe per lectura\n"); fd = open("myfifo", O_RDONLY); printf("Llegint missatge\n"); read(fd, buf, 5); printf("Rebut %s, tancant.\n", buf); close(fd); }
C
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "common/memory.h" #include "parser.h" #include "c_codegen_visitor.h" #define V_INIT(lhs, rhs) visitor->visit_##lhs = &c_codegen_visit_##rhs static int tab_level = 0; static FILE* out; static void _tab(); static char* _get_type_string(PrimitiveTy...
C
#include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <semaphore.h> #include "frame.h" int envoi_frame (int sock , entete_frame * ettf , void * data ) { /*if (log_mesg (0, 40 , LOG_GENERAL ,"envoi frame %d %d %d %d" , ettf -> type , ettf -> sous_type , ettf -> offset , ettf -> longueur ) < 0) r...
C
#include <stdlib.h> #include "dynarray.h" status myDynarrayInit(myDynarray *a, int number) { a->data = malloc(number*sizeof(MYDYNARRAY_TYPE)); a->elements = 0; a->max = number; return a->data == NULL ? failure : success; } status myDynarrayAdd(myDynarray *a, int data) { if(a->elements == a->max) ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* show.c :+: :+: :+: ...
C
#include <math.h> #include <stddef.h> #include <stdlib.h> #include <assert.h> #include <stdio.h> #include "tree.h" #include "geom.h" #include "probes.h" vox_dot vox_voxel = {1.0, 1.0, 1.0}; #ifdef STATISTICS static void update_fill_ratio (const struct vox_box *box, size_t n) { float bb_volume, vox_volume; vo...
C
#include<stdio.h> int main(){ int n,k,i,a=0; scanf("%d %d",&n,&k); int con[n]; for(i=0;i<n;i++){ scanf("%d",&con[i]); } for(i=0;i<n;i++){ if(con[i]>=con[k-1] && con[i]!=0) a++; } printf("%d",a); return 0; }
C
#include "shell.h" void exec_cd(char *arg, char **args) { if (args[1] == NULL || args[1][0] == '\0') chdir(home); else if (args[2] != NULL && args[2][0] != '\0') write(1, "cd: invalid usage\n", 19); else if (strcmp(args[1], ".") == 0) return; else if (args[1][0] == '~') { ...
C
#include<stdio.h> /** * main - check the code for Holberton School students. * * * Return: Always 0. */ int main(void) { long int in, ln, iter, itnum, sum; long int next; itnum = 29; in = 1; ln = 2; sum = 0; for (iter = 0; iter <= itnum; iter++) { next = in + ln; in = ln; ln = next; if (next % 2...
C
#include "../config.h" #include "mem.h" #include "../libc/stdlib.h" /* * Good reference for memory maps * https://wiki.osdev.org/Memory_Map_(x86) */ /* * Physical memory allocation happens on the largest section of detected free memory * It's allocated in 4096 byte chunks using simple flat list allocation * ...
C
#include <stdio.h> #include <stdlib.h> int main(int argc, const char** argv) { double x = 13.12; printf("%p\n", x); return EXIT_SUCCESS; }
C
#include <stdio.h> #include <stdlib.h> #include <string.h> //Autores: Matheus Bosco, Vinicius Solon , Rafael Neder /* run this program using the console pauser or add your own getch, system("pause") or input loop */ typedef struct Carro{ char placa[8]; char marca[12]; char modelo[12]; } Carro; void imprimeCarro(...
C
#pragma once #include <stdint.h> #include <stddef.h> #ifdef __cplusplus extern "C" { #endif typedef struct nui_color { union { struct { uint8_t r, g, b, a; }; // Just for aligning the struct to 4 bytes. // Can be used to read all channels _in_ C! uint32_t impl_align; }; } nui_color; typedef struct n...
C
//һij̶ȡΪа2ĸλıֵǸ̶0.5Ǹż //1֡-13142223336Ǹ11λ32ǸҲżķ̶ȼΪ //3/11*1.5*2*100%ԼΪ81.82%һж //ʽ //һиһ50λN //ʽ //һNij̶ȣСλ // //-13142223336 // //81.82% #include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char n[10000];//nַ int c,i; int count=0; double num; scanf("%s",n); int len; len = strlen(n); for(i = ...
C
#ifndef __COMMON_H__ #define __COMMON_H__ #include <stdlib.h> #include <string.h> #include <errno.h> #include <stdio.h> #include <unistd.h> /* common macros */ #define CYAN "\e[0;36m" #define GREEN "\e[0;32m" #define RED "\e[0;31m" #define RESET "\e[0m" #define color_print(stdfile, color, x, ...) fprintf(stdfile...
C
// binary semaphore #include<stdio.h> struct semaphore { enum value(0, 1); // q contains all Process Control Blocks (PCBs) // corresponding to processes got blocked // while performing down operation. Queue<process> q; } P(semaphore s) { if (s.value == 1) { s.value = 0; } else { // add the p...
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 <stdio.h> #include <limits.h> struct Height { int feet; int inches; }; int findMax(struct Height arr[], int n) { int mx = INT_MIN; for(int i = 0; i < n; i++) { int temp = 12 * (arr[i].feet) + (arr[i].inches); if(temp > mx) { mx = temp; } ...
C
#include<stdio.h> #include<stdlib.h> typedef struct node { int data,data2; struct node *next,*prev; }list; list *Newnode(int i) { list *newnode; newnode=(list *)malloc(sizeof(list)); newnode->data=i; newnode->next=NULL; newnode->prev=NULL; return newnode; } void insert(list **root) { char a; int i,j; s...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* indexation.c :+: :+: :+: ...
C
#include <string.h> #include <emmintrin.h> #include <stddef.h> #include <stdint.h> /* the calls to memcpy() here implement unaligned accesses, and are compiled by gcc to mov instructions (even if you call this function memcpy, too) */ void *ssememcpy(void *dest, const void *src, size_t n) { if (n<9) { if (...
C
/* * 24AA04_EEPROM.c * * Created on: 10/04/2014 * Author: rust */ #include <msp430.h> #include "usi_i2c.h" #define ADDRESS 0xA0 #define BLOCK_BIT 0x02 #define RW_BIT 0x01 #define BLOCK_SIZE 16 // Bytes (maximum in each write cycle) #define EEPROM_SIZE 512 // Bytes typedef enum writeArrayEnum {...