language
large_stringclasses
1 value
text
stringlengths
9
2.95M
C
#include<errno.h> #include<unistd.h> #include<stdio.h> ssize_t readn(int fd,void* buf,size_t count) { int nleft=count;//剩余字节数 char*p=buf; while(nleft>0) { int r=read(fd,p,nleft); if(r==0) return count-nleft;//实际读写的字节数 if(r==-1) { if(errno==EINTR) ...
C
//C program TO find GCD of 2 positive integers.... #include <stdio.h> /*Recursive way*/ long gcd(long x, long y) { if (y == 0) { return x; } else { return gcd(y, x % y); } } /*Without recursion long gcd(long x, long y) { if (x == 0) { return y; } while (y != 0) { if (x > y) ...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct DataNode { char* cmd; char* desc; int (*handler)(); struct DataNode *next; } tDataNode; int Quit() { exit(0); return 0; } int Sing() { printf("Guaguagua~~Guagua~~\n"); return 0; } int Cry() { ...
C
/* * cardtest1.c * */ /* * Include the following lines in your makefile: * * cardtest1: cardtest1.c dominion.o rngs.o * gcc -o cardtest1 -g cardtest1.c dominion.o rngs.o $(CFLAGS) */ #include "dominion.h" #include "dominion_helpers.h" #include "rngs.h" #include <string.h> #include <stdio.h> #include <assert.h> #...
C
#include "head.h" #include <limits.h> static Pixel * _img_cpy; static int _size = 0; static int _sizeXimg = 0; static int profondeur_max = 10; static int taille_nb_pixel = 2048; static int _taux = 1; GLubyte * im; int _nb = 0; int nbcoul_max = 0; int tableau[255][255][255]; // ********************************** // D...
C
#include<stdio.h> #include<stdlib.h> int main(void) { int i; char *ptr1 = NULL, *ptr2; ptr1 = (char *) malloc(5); printf("ptr1: %x", ptr1); ptr2 = malloc(20); printf("ptr2: %x", ptr2); for (i = 0; i < 10; i++) { ptr1[i] = i; } *ptr2 = 99; for (i = 0; i < 10; i++) { printf(" %d\n", ptr1[i]); } retu...
C
#include <stdio.h> int main () { int a=10; printf("Hello\n"); goto cse; a++; printf("C programming"); cse: printf("value of a= %d",a); return 0; }
C
/** ****************************************************************************** * @file modules/common/c_common_gpio.h * @author Martin Vincent Bloedorn * @version V1.0.0 * @date 30-November-2013 * @brief Fuções de configuração e uso de GPIO baseadas na CMSIS do STM32F4. * * TODO * * \to...
C
#include <stdio.h> #include <math.h> float n1, n2 ,n3, quadrado, concatenacao; int main(){ scanf("%f%*c",&n1); scanf("%f%*c",&n2); scanf("%f",&n3); if(((n1<10) && (n1>=0) && (n1==(int)n1)) && ((n2<10) && (n2>=0) && (n2==(int)n2)) && ((n3<10) && (n3>=0) && (n3==(int)n3))){ concate...
C
#include <stdio.h> #include <stdlib.h> #include <string.h> struct address { char *city; char *street; int zipcode; }; struct test { int data; struct test *self_pointer; struct address addr; // 함수 포인터 - 다형성 // 이 부분은 Lv3 소프트웨어 아키텍처링(설계) 파트에서 좀 더 상세하게 다룰 내용 // 생산성을 증대시키면서 유지보수성을 함께 올릴 수 있는 방법은 무엇인가 ? // 100명 ~...
C
#include "binary_trees.h" /** * binary_tree_insert_right - inserts a new node into the right slot of parent * @parent: node to update the left of * @value: value to store in new node * * Return: pointer to new node, else NULL */ binary_tree_t *binary_tree_insert_right(binary_tree_t *parent, int value) { binary_tree_t...
C
#include <stdio.h> #include <stdlib.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { int *ptr; int i; ptr = (int *)calloc(5, sizeof(int *)); if(ptr!=NULL) { *ptr = 1; *(ptr+1) = 2; ptr[2] = 4; ptr[3] = 8; ptr[4] = 16; ...
C
#include "shell.h" /** * buffer_reallocate - resize and copy over into new buffer space * @b: pointer to buffer structure */ void buffer_reallocate(buffer *b) { char *tmpbuf; tmpbuf = b->buf; b->size *= 2; b->buf = safe_malloc(sizeof(char) * b->size); _memcpy(b->buf, tmpbuf, b->size / 2); _free(tmpbuf); } /**...
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> #define MAXSIZE 1000 void strncpyP(char *s, char *ct, int n); void strncatP(char *s, char *ct, int n); int strncmpP(char *cs, char *ct); int main() { char s[MAXSIZE] = "testing the function strncopy"; char *ct = "strncpy cat"; int n = 4; printf("strncatP --- s: %s ct: %s n: %d", s, ct, n);...
C
// Author: Aaron D. Vose // License: This is software is released into the public domain by the author in March 2013. #include <stdio.h> #include <stdlib.h> #include <string.h> #include "fastautil.h" #include "peptide.h" double *IsotopicMass=NULL; //////////////////////////////////////////////////////////////////...
C
/***************************************************************** * ChatFe - Progetto di Sistemi Operativi '14/'15 UniFe * * * * Riccardo Padovani (115509) riccardo@rpadovani.com * ***************************************************...
C
#include <math.h> #include "Params.h" #define PI 3.141592 /*--- affine --- gk,],ړi`Ԗ@j------------------------------ image_in: ͉摜z image_out: o͉摜z deg: ]pixj zx: g嗦ij zy: g嗦icj px: ړʁij py: ړʁicj -----------------------------------------------------------------------------*/ void affine(unsigned char ...
C
/* Sept 2013 bgc32 Rev - Copyright (c) 2013 John Ihlein. All rights reserved. Open Source STM32 Based Brushless Gimbal Controller Software Includes code and/or ideas from: 1)AeroQuad 2)BaseFlight 3)CH Robotics 4)MultiWii 5)S.O.H. Madgwick 6)UAVX Designed to run on the EvvGC Brushless Gimb...
C
#include<stdio.h> int fecto(int n) { if (n == 1) { return 1; }else { return n*fecto(n - 1); } } int main(void) { int n = 5, sum = 0; sum = fecto(n); printf("%d 丮 %d",n, sum); return 0; }
C
#include<stdio.h> #include<stdlib.h> #include<omp.h> #include<mpi.h> #define THREADS 2 #define Row 9800 #define Col 9800 int main(){ int a[Row][Col], b[Row][Col], c[Row][Col], chunk=10, i,j,k,tmp, tid, nthreads; double start, end; start = MPI_Wtime(); omp_set_dynamic(0); omp_set_num_threads(2); #prag...
C
//stack.c #include "stack.h" bool stackCreate(Stack *stack, int elementSize) { //assert(elementSize > 0); if (elementSize > 0) { stack->elementSize = elementSize; stack->logLength = 0; stack->allocLength = kInitialAllocationSize; stack->elements = malloc(kInitialAllocationSize * elementSize); /...
C
#include<stdio.h> //#include<iostream> //#include<cstdio> //using namespace std; int main() { double i=0,x,y; int h,u,d,f,k; while(scanf("%d %d %d %d",&h,&u,&d,&f)==4 && h!=0) { i=0; k=1; y=u; x=(u*f)/100.0; while(1) { if(y>0) i...
C
#include <stdio.h> int main() { int a,b; scanf("%d", &a); b=0; while(a>0){ a/=10; b+=1; } printf("%d\n", b); return 0; }
C
//Student Details #include"stdio.h" main() { char n1[10],n2[10],n3[10],r[15],p[10]; char email[35]; printf("\n\n\t\t\tEnter Student Details:\n"); printf("\t\t\t----------------------"); printf("\n\tEnter Student Name \t:"); scanf("%s%s%s",&n1,&n2,&n3); printf("\n\tEnter Student Reg.no \t:"...
C
#ifndef TEMPCONVERT_H_INCLUDED #define TEMPCONVERT_H_INCLUDED float convertTemperature(float); float convertTemperature(float temp) { float returnValue; returnValue = ((temp * 9) / 5) + 32; return returnValue; } #endif // TEMPCONVERT_H_INCLUDED
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <ctype.h> //auxiliary list typedef struct nList{ int accId; struct nList* next; }nList; void insertL(nList** l, int accId); void insertStart(nList** l, int accId); void deleteL(nList** l); void printListL(nList* l); void print...
C
#include<stdio.h> int sum(int); int main() { int di; printf("enter the value \n"); scanf("%d",&di); printf("%d \n",sum(di)); return 0; } int sum(int d) { int y=0; int last; if(d==0) { return 0; } y=d%10; d=d/10; y=y+sum(d); return y; }
C
#include<stdio.h> int largest(int *,int *,int *); int main() { int num1,num2,num3,*p1,*p2,*p3,n; printf("\n Enter Three Numbers Please:\n"); scanf("%d\n%d\n%d",&num1,&num2,&num3); p1=&num1; p2=&num2; p3=&num3; n=largest(p1,p2,p3); printf("\n The Lagest Number is %d",n); return 0; } int largest(in...
C
/* Knapsack */ #include <stdio.h> #include <stdlib.h> #define N 5 #define S 6 int Values[N] = {5,5,4,3,2}; int Sizes [N] = {4,1,2,3,1}; int Keep [N+1][S+1]; int Max[N+1][S+1]; int max (int a, int b) { if (a>b) return a; return b; } /* int knapsack (int *V, int *Sizes, int size, int i, int n) { int wit...
C
#include <stdio.h> int g(int); main() { int a; char b; float c; int d[5]; char e[5]; float f[5]; printf("̸ Է : "); scanf("%s", e); printf("Է ̸ : %s\n", e); printf(" Է : "); scanf("%d", &a); if(a >= 20) { printf("Դϴ.\n"); } else { ...
C
#pragma once #include <stdio.h> #include <stdlib.h> #include <string.h> #define _CRT_SECURE_NO_WARNINGS /** 豸Ϣṹ */ typedef struct _equipment_data { int ID;// char name[50];// char kind[20];//ͺ char manufacturer[50];// int buyYear;// int buyMonth;// int buyDay;// int state;//״̬01ã }EquipmentData; /** άϢ */ typed...
C
#include <stdio.h> #include <string.h> void ex1(){ // methode 1 char chaine1[]="Je n'aime pas le chocolat"; printf("%s et sa longueur %d\n",chaine1,strlen(chaine1)); } void ex2(){ // methode 2 printf("saisissez une chaine de caractere = \n"); char chaine2[26]; fgets(chaine2,26,stdin); ...
C
#include<stdio.h> int main() { float num; int x; printf("enter the number"); scanf("%f",&num); x=num+0.5; printf("%d",x); return 0; }
C
#include <stdio.h> #include <stdlib.h> #include <string> #include <fstream> int main() { int n1,n2; char op; int resultado; //N1 OP N2 = RESULTADO; FILE *calculadora; calculadora = fopen("calculadora.txt","a+"); if(calculadora == NULL){ printf("Nao foi po...
C
#include "network.h" #include "communication.h" #include <stdio.h> #include <signal.h> int count = 0; void printCtrlC() { printf("messages received: %d\n", count); exit(1); } int main(){ network_init(); signal(SIGINT, printCtrlC); msg_t msg; ipv4 ip; udp_open(LISTEN); while(1){ if(udp_receive(&msg)){ ...
C
#include <stdio.h> int soma(int n1, int n2) { return (n1 + n2); } int sub(int n1, int n2) { return (n1 - n2); } int main(void) { int a, b, op, numeros; printf("Informe dois numeros\n"); scanf("%d %d", &a, &b); printf("1 para soma\n\tOU\n2 para subtração\n"); scanf("%d", &op); if (o...
C
#include <stdio.h> #include <stdlib.h> struct node { int data; struct node *link; }; typedef struct node NODE; NODE *head = NULL; void add_at_end(NODE *head, int data) { NODE *ptr, *temp; ptr = head; temp = malloc(sizeof(NODE)); temp->data = data; temp->link = NULL; ...
C
#include "hash_tables.h" /** * hash_table_set - check the code for Holberton School students. *@ht: hash table *@key: is hte key *@value: value associated with the key * Return: new_nod. */ int hash_table_set(hash_table_t *ht, const char *key, const char *value) { unsigned long int in, ct; hash_node_t *node; ...
C
#ifndef MAT4_H #define MAT4_H #include "Mat2.h" #include "Mat3.h" #include "Vec2.h" #include "Vec3.h" #include "Vec4.h" //a and b are the two columns of this matrix typedef struct { Vec4 x; Vec4 y; Vec4 z; Vec4 w; } Mat4; float Mat4_get_index(Mat4* m, int r, int c); Vec4 Mat4_col(Mat4 m, int c); Vec4...
C
/** * @file ex3_bb_chardrive.c * @author Santosh Pai * @date 15 may 2018 * @version 0.1 * @brief An introductory "Char device driver" loadable kernel module (LKM) that can display a message * in the /var/log/kern.log file when the module is loaded and removed. The module can accept an * we used fs.h file...
C
#ifndef OBJECTS_MARIO_H #define OBJECTS_MARIO_H #include "./types.h" struct Mario : Object { int Coins; int prevX; int prevY; Mario() { this->X = 0; this->Y = 0; this->Width = 34; this->Height = 34; this->Coins = 0; this->prevX = 0; this->prevY...
C
/** @file multiTask.h * @brief functions related to task, The OS supports Multi Task. * * The multiTask include create task, run task, sleep task, stop task, switch task. etc. */ #ifndef _MULTI_TASK_H_ #define _MULTI_TASK_H_ #include "string.h" #include "typedef.h" #include "tim.h" #include "globalTbl.h" #incl...
C
#include <stdio.h> #include <stdint.h> #include "md5.h" void print_usage(); /*** Main Routine ********************************************************/ int main(int argc, char *argv[]) { uint32_t sum[4]; FILE *file = NULL; if (argc == 1) { print_usage(argv); return 0; } file = fopen(argv[1], "r"); if (...
C
/*char *freemap = NULL; // Freemap functions void freemap_init(){ freemap = malloc(BLOCKCOUNT / sizeof(char)); } void freemap_cleanup(){ free(freemap); }*/ /* Example freemap freemap = { 0x00011111, 0x11111111, 0x11000000, 0x00000000 }; * Freemap after running freemap_set(0, 4, 16) freemap = { 0x00000000, ...
C
#include <stdlib.h> #include <inttypes.h> #include "struct_defines.h" #include "conv.h" #include "OperatingRegion.h" void lmcp_pp_OperatingRegion(OperatingRegion* s) { printf("OperatingRegion{"); printf("ID: "); printf("%lld",s->ID); printf("\n"); printf("KeepInAreas: "); printf("["); for (...
C
#include "system.h" /********************************************************************* * Function: void Timer0Init(void) * Input: void * Output: void * Overview: This function initializes Timer1. ********************************************************************/ void Ti...
C
#include "defs.h" #include "stdio.h" int read_tag_head(int fd,unsigned char *buff, int len) { int retval = 0; retval = read(fd, buff, len); return retval; } /*int get_4byte_integer(char *buff) { } int get_3byte_integer(char *buff) { } */ void parsing_tag_head(unsigned char *buff,int len,...
C
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { //Checks if there is an input in the command line arguments. if (argc != 2) { printf("No file found\n"); return 1; } //Puts the data from card.raw into the input pointer. FILE *input = fopen(argv[1], "r");...
C
/* @date: 2020-08-13 19:46:33 @功能: @目的: */ int main(void) { if (0) { printf("AAA\n"); printf("BBB\n"); } else { printf("CCC\n"); } return 0; } /*在VScode中的输出: 总结: */
C
#include "UI.h" #include <stdio.h> #include <ctype.h> Console* createConsole(Service* service) { Console* console = (Console*)malloc(sizeof(Console)); if (console == NULL) { return NULL; } console->service = service; return console; } int ui_add(Console* console, char* command) { int serialNum...
C
#include <stdio.h> #include <stdlib.h> void sum_square_difference(int n){ int sum_of_square, square_of_sum; sum_of_square = n*(n+1)*(2*n+1)/6; square_of_sum = n*n*(n+1)*(n+1)/4; printf("%d", square_of_sum - sum_of_square); } int main(int argc, char *argv[]) { sum_square_difference(100); }
C
/* * File: main.c * Author: sglee * * Created on 2018-9-12, PM 11:37 */ #include <xc.h> #define _XTAL_FREQ 4000000 #include <pic18.h> #include "configuration_bits.h" // https://openlabpro.com/guide/pulse-width-modulation-using-pic18f4550/ // http://www.micro-examples.com/public/microex-navig/doc/097-pwm-cal...
C
#include <stdio.h> #include <stdlib.h> long GCD(long a,long b){ if(b==0){ return a; }else{ return GCD(b,a%b); } } int main() { printf("Hello world!\n"); printf("%lu ",GCD(18,35)); printf("%lu ",GCD(28851538,1183019)); return 0; }
C
/* expression.c */ #include "search.h" #include <errno.h> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <dirent.h> #include <sys/wait.h> #include <unistd.h> /** * Executes the -print or -exec expressions (or both) on the specified path. * @param path Path to a file or directory * @...
C
/** * @file llist.h * @brief A Generic Linked List * @details A Generic Linked List. This is not thread safe * * @authors David Muto (pseudomuto) | Contact: <david.muto@gmail.com> * @authors Pham Ngoc Thang (thangdc94) * @see https://gist.github.com/pseudomuto/6334796#file-sample_app-c * @see http://pseudomut...
C
#include "ParallaxBackground.h" #include "Game.h" #include "../Graphics/Drawing.h" void InitializeParallaxBackground(ParallaxBackground *self, const char *file1,const char *file2,const char *file3,const char *file4, int start1,int start2,int start3,int start4,int end1,int end2,int end3,int end4) { /* self->layers[0]=D...
C
/* This file is part of Olono Copyright (C) 2008 Martin Potier (<mpotier@isep.fr>) and David Wagner (<dwagner@isep.fr>) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free So...
C
// Porres 2016 #include "m_pd.h" #include <math.h> static t_class *ratio2cents_class; typedef struct _ratio2cents { t_object x_obj; t_outlet *float_outlet; t_int bytes; t_atom *output_list; t_float f; } t_ratio2cents; static void *ratio2cents_new(t_floatarg f1); static void ratio2cents_free(t_ratio2cents...
C
#include <stdio.h> #include<string.h> long long gcd(long long int a,long long int b) { while(a!=b) { if(a>b) a=a-b; else b=b-a; } return a; } int main(void) { // your code goes int t; scanf("%d",&t); while(t--) { char s[15]; scanf("%s",s); int l=strlen(s); int i,a=0,d=1,c=0,flag=0; for(i=l...
C
#include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <inttypes.h> #include <netinet/in.h> #define BUF_SIZE 800 #define SERVER_PORTNUM 9000 #define QUEUE_SIZE 1 uint32_t reverse_bytes_32(uint32_t bytes){ uint32_t aux = 0; uint8_t ...
C
#include <stdio.h> //Scan the chessboard column by column int vertical(int ROW, int COL, char matrix[ROW][COL]) { //check if any column ever has more than 1 queen int counter = 0; for (int col = 0; col < COL; col++){ if (counter <= 1){ counter = 0; for (int line = 0; line < ROW; line++){ c...
C
#include <stdio.h> int main() { int Num; printf ("Escribe la nota numérica: "); scanf ("%d",&Num); if ((Num==5)|| (Num==6)){ printf ("Aprobado"); } else{ if((Num==7)||(Num==8)){ printf ("Notable"); } else { if((Num==9)||(Num==10)){ printf ("Sobresaliente"); } e...
C
#include "crio_util.h" #include <string.h> /* Return 1 if the external pointer has a tag slot matching the * specified prefix, 0 otherwise. */ int crio_is_valid_xp(SEXP xp, const char *prefix) { if (TYPEOF(xp) == EXTPTRSXP) { SEXP tag = R_ExternalPtrTag(xp); if (isString(tag) && LENGTH(tag) == 1)...
C
#include "include.h" #include "xlib.h" #ifndef __FreeBSD__ #include <stdio_ext.h> #endif void xfpurge(FILE *stream) { #ifndef __FreeBSD__ __fpurge(stream); #endif #ifdef __FreeBSD__ if (fpurge(stream) == EOF) { xwrite(2, "fpurge failed\n", 14); exit(EXIT_FAILURE); } #endif } void xfclose(FILE *...
C
#include "list_test.h" #include "alloc.h" #include "util.h" uint32_t list_test(void) { list_t list; list_elem_t *new[LIST_TEST_ELEM_NO], *elem; uint8_t list_test_val[LIST_TEST_ELEM_NO] = {100, 50, 80, 100, 200, 150}; uint8_t list_test_val_ord[LIST_TEST_ELEM_NO] = {50, 80, 100, 100, 150, 200}; uint...
C
#include <stdlib.h> #include "lists.h" #include <stdio.h> /** * *insert_nodeint_at_index - Entry Point * @head: variable * @idx: variable * @n: variable * Return: 0 */ listint_t *insert_nodeint_at_index(listint_t **head, unsigned int idx, int n) { listint_t *nuevo_nodo, *tmp; if (head == NULL) return (NULL); ...
C
#include<stdio.h> void main() { int userchoice,matchstick=21,computerchoose; //main logic here is 5-userchoice while(matchstick>0) { printf("Enter matchstick 1 to 4 :: "); scanf("%d",&userchoice); printf("\n"); if(userchoice>0&&userchoice<5) { computerchoose=5-userchoice; printf("Computer Chooses =...
C
#include <stdio.h> int main(int argc, const char *argv[]) { int i = 0; int j = 0; int min = 0; int tmp = 0; int a[11]; printf("Please input 10 numbers :\n"); for(i = 1;i <= 10;i++) { printf("a[%d] = ",i); scanf("%d", &a[i]); } printf("\n"); printf("The orig...
C
#include<stdio.h> int rec_bin(int num); void main() { int num; printf("\nEnter Number: "); scanf("%d", &num); printf("Decimal To Binary Using Recursion: %d", rec_bin(num)); } //Creating a recursive function to evaluate decimal to binary int rec_bin(int num) { if(num==0) { return 0; } else ...
C
/* * error.h * * Written by: Stefan Frank * Ullrich Hafner * * This file is part of FIASCO (Fractal Image And Sequence COdec) * Copyright (C) 1994-2000 Ullrich Hafner <hafner@bigfoot.de> */ /* * $Date: 2000/06/14 20:49:37 $ * $Author: hafner $ * $Revision: 5.1 $ * $State: Exp $ */ #ifndef _E...
C
#include "holberton.h" #include <stdlib.h> #include <stdio.h> /** * create_array - creates an array of chars. * @size: size of the array. * @c: specific char that initializes the array. * * Return: NULL if size = 0 or fail, if successful pointer to array. */ char *create_array(unsigned int size, char c) { char ...
C
#include<stdio.h> void main() { int n,sum=0; scanf("%i",&n); while(n>0) { sum++; n=n/10; } printf("%i",sum); }
C
#include <unistd.h> #include <stdio.h> #include <sys/socket.h> #include <stdlib.h> #include <netinet/in.h> #include <string.h> #define PORT 8080 /* This file contains code needed to: Create a socket for the server Bind a socket to an address Listen for an incoming connection Accept an incoming co...
C
#include "../inc/libmx.h" bool mx_islower(int c) { return (c >= 97 && c <= 122); } bool mx_isdigit(int c) { return (c>=48&&c<=57); } unsigned long mx_hex_to_nbr(const char *hex) { int len = 0; for (; *(hex + len) != '\0'; ++len) { } unsigned long base = 1; unsigned long de...
C
#include "include/header.h" #include <stdio.h> #include <float.h> #include <limits.h> #include <stdint.h> #include <stdlib.h> #include <stdarg.h> int main() { t_arg arg; arg.accuracy = 20; // double d = 2345.23452345; // long double ld = LDBL_MAX; // float f = -37.0777779; printf("% 05.0f\n", 7.3); ft_printf...
C
#include <stdio.h> #include <stdlib.h> #include <WinSock2.h> #define MSG_LEN 30 void ErrorHandling(char *msg); int main(void) { WSADATA wsaData; SOCKET hSocket; SOCKADDR_IN servAddr; char message[MSG_LEN]; int strLen; // ̺귯 ʱȭ if(WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) ErrorHandlin...
C
#include "queue.h" #include <stdio.h> #include <stdlib.h> #include <string.h> //////////////////////////////////////////queue_array////////////////////////////////////////// static int queue_array_init(queue_array *this, int size , int element_size); static int queue_array_resize(queue_array *this, int newsize); void ...
C
#pragma once #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <stdlib.h> #define NAME_MAX 10 #define SEX_MAX 3 #define TELE_MAX 12 #define ADDR_MAX 30 typedef struct PeopInfo { char name[NAME_MAX]; int age; char sex[SEX_MAX]; char tele[TELE_MAX]; char addr[ADDR_MAX]; } PeopInfo; t...
C
/************************************************************************* > File Name: EP08.c > Author: wangshuai > Mail: ws1519704327@126.com > Created Time: 2019年12月20日 星期五 09时11分44秒 ************************************************************************/ #include <stdio.h> #include <string.h> #d...
C
//the pointer excercise #include <stdio.h> main() { int *p,i=10,j,k; p=&i; putchar(p); *p=*p+1; printf("%d\n",p); printf("%d\n",p); j= *p; putchar(j); k=*(&i); printf("%d",k); return 0; }
C
/// Break.c /* ported 7/11/96 DS no mods. */ /* Ported to H8S2623 - 01/03/99 (DTH) - No modifications */ // Ported to 2633 1/10/01 DGL - No mods #pragma section MONITOR #include "bptable.h" #include "break.h" #define NULL 0 char BreakPointExists (SH_REG); void BPinitialise(void) { InitBreakTable(); } /* C...
C
#include <stdio.h> #ifdef WINDOWS #define COLOR_YELLOW "" #define COLOR_GREEN "" #define COLOR_BLUE "" #define COLOR_CYAN "" #define COLOR_WHITE "" #else #define COLOR_YELLOW "\x1B[33m" #define COLOR_GREEN "\x1B[32m" #define COLOR_BLUE "\x1B[34m" #define COLOR_CYAN "\x1B[36m" #define COLOR_WHITE ...
C
/** * @file * @auther Jessica Li, Jingwen Wang, Hamik Mukelyan * * Contains some constants used in the simulation. */ #ifndef UTIL_H #define UTIL_H const int BYTES_PER_KB = 1 << 10; /** Conversion factor between kilobytes and megabytes. */ const int KB_PER_MB = 1 << 10; /** Conversion factor between bits and...
C
#define _CRT_SECURE_NO_WARNINGS 1 #include "Graph.h" //ڽӾ void CreatMGraph(MGraph *G){ int i, j, k, m,w; char s; printf("붥ͱ\n"); scanf("%d %d", &G->numver, &G->numedge); for (i = 0; i < G->numver; i++){ G->vex[i] = 'A'+i; } for (i = 0; i < G->numver; i++){ for (j = 0; j < G->numver; j++){ if (i == j){ ...
C
#include<stdio.h> void main() { int a,b,c; printf("enter the no of ninjas in kabali's clan and opponent's clan"); scanf("%d%d",&a,&b); c=a-b; printf("%d",c); }
C
// Implemente um algoritmo para testar se uma árvore binária é simétrica. Uma árvore binária é simétrica de si se // suas sub-árvores são imagens espelhadas idênticas. Por exemplo, as duas primeiras árvores abaixo são // simétricas, mas as duas últimas não são. #include "stdio.h" #include "stdlib.h" #include "Arvore.h...
C
#include "output_stream.h" #include "library.h" #include "varargs_loading.h" #include "printing.h" int my_printf(const char *format, ...) { va_list va_list; va_start(va_list, format); int result = my_vprintf(format, va_list); va_end(va_list); return result; } int my_fprintf(struct output_stream ...
C
/* Prints a FILETIME value * Returns 1 if successful or -1 on error */ int info_handle_filetime_value_fprint( info_handle_t *info_handle, const char *value_name, uint64_t value_64bit, libcerror_error_t **error ) { system_character_t date_time_string[ 48 ]; libfdatetime_filetime_t *filetime = NU...
C
/* ==========---------- Math Final Result Calculating ----------========== Author: Jayed Hoshen Version: 0.01 Initial Relese: 30-04-2020 Input & Condition: First exam 25%, Second exam 25% and Final exam 50% marks Output: Total marks of math */ #include <stdio.h> #include <stdlib.h> int main() { ...
C
/* ** EPITECH PROJECT, 2020 ** player ** File description: ** Player's functions */ #include <stdlib.h> #include "../../include/my.h" #include <stdio.h> struct match remove_match(struct match map_data, int b, int c) { int a = 0; for (a = 0; map_data.map[b - 1][a] != '\0'; a++); map_data.left_matches[b -...
C
#ifndef TC_ARRAY_H_INCLUDED #define TC_ARRAY_H_INCLUDED #include <xcopy.h> struct tc_array_s{ void *elts; unsigned int nelts; size_t size; unsigned int nalloc; tc_pool_t *pool; }; tc_array_t *tc_array_create(tc_pool_t *p, unsigned int n, size_t size); void tc_array_destroy(tc_ar...
C
// Imprime en pantalla una tabla de ciudades y su representacion en caracteres alfabeticos // Imprime en pantalla una tabla de ciudades y su representacion en codigo ASCII #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i, j; char CIUDAD[][18] = {"ALEJANDRIA", "CONSTANTINOPLA", "...
C
#include<stdio.h> #include<omp.h> int g = 10; void foo() { int x; x = 10; } int main () { int x = 0; #pragma omp parallel private(x) { int i; i = x + i + g; foo(); for (i = 0; i < 4; i++) { #pragma omp critical { printf("Iteration %d by Thread %d\n", i, omp_get_thread_num()); } #pragma omp single ...
C
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* funcs.c :+: :+: :+: ...
C
//copia contenido de una matriz en otra #include <stdio.h> #include <stdlib.h> //para usar memoria dinamica //////////////////////////////////////////////////////////// int main(){ int filas, colum, i, j; int **m1; int **m2; int **m3; printf("Numero de filas: "); scanf("%i", &filas); printf("Numero ...
C
//double-free-ptr2.c #include <stdio.h> #include <stdlib.h> struct { int mchunk_prev_size; int mchunk_size; }fake_chunk; void main() { int i; void *a, *b; printf("&fake_chunk=%p\n", &fake_chunk); a = malloc(16); b = malloc(16); free(a); free(b); //bypass fasttop ...
C
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include <usloss.h> #include <phase1.h> #include "phase2Int.h" typedef struct Sleeper{ int WAKEUPwakeup; // Chop Suey! int timeGoSleep; // when the process went to sleep int pid; // process of id that went to sleep int con...
C
/** * @file Result.h * @author Douglas Reis * @date 30/05/2019 * @version 1.0 * * @author Eng. Douglas Reis * @section LICENSE * @section DESCRIPTION */ #ifndef SRC_Template_StatusCode_H_ #define SRC_Template_StatusCode_H_ /** * @defgroup StatusCode Status Code * @ingroup CommandProtocol * @{ * @p...
C
/* * Function to apply operator to integer array */ #include <stdio.h> /* scanf, printf */ #include <stdlib.h> /* abort */ #include <assert.h> /* assert */ /* declare function prototype to give as * input to the 'apply' function */ typedef int (* Operator) (int arg1, int arg2); int apply(int * X, int n, Oper...