language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /*
IMPLEMENTATION MODULE MCTTT
Dieses Modul implementiert die Transilient Turbulent Theory.
*/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include "mcglobal.h"
#include "mcpress.h"
#include "sunpos.h"
#include "mcground.h"
#include "mcttt.h"
#ifdef PARALLEL
#... |
C | #include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
int main()
{
int retval, shmid ;
void *memory = NULL ;
char *p ;
shmid = shmget ((key_t)123456789,6, IPC_CREAT|0666);
if ( shmid < 0 )
{
printf("\n error shmget");
}
printf("\n getting the shared %d"... |
C | #include <stdio.h>
#include <stdlib.h>
#include "board.h"
#include "win.h"
#include "play_the_game.h"
/*this program takes input from the user and then creates a board depending on the columns and
rows and then asks the user to input the col they want to play in and then plays a game of connect-n
depending o... |
C | #include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
int main(int argc, char const *argv[])
{
struct in_addr addr;
int ret;
char *c=NULL;
ret=inet_aton(argv[1],&addr);
if(ret>0)
{
printf("addr=%x\n",addr.s_addr);
c=(char*)&addr;
printf("ip1=%x.%x.%x.%x\n",*c&0xff,*(c+1)&0xff,*(c+2),*(c+... |
C | /** \brief Carga los datos de los empleados desde el archivo data.csv (modo texto).
*
* \param path char*
* \param pArrayListEmployee LinkedList*
* \return retorna 1 si da error, y 0 si carg los datos con xito
*
*/
int controller_loadFromText(char* path , LinkedList* pArrayListEmployee);
/** \brief Carga los d... |
C | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
// Constantes
#define tamanho 5
// Estrutura da pilha
struct tpilha{
int dados[tamanho];
int ini;
int fim;
};
// Variveis globais
struct tpilha pilha;
int op;
// Prototipao
void pilha_entrar();
void pilha_sair();
void pilha_mostrar();
// Funo p... |
C | #include "phone.h"
void printall(Person* ptr, int *num) {
int i = 0;
printf("<<Display all contacts in the PhoneBook>>\n");
if (*num > 0) {
for (i = 0; i < *num; i++) {
printf("%s ", ptr[i].name);
printf("%s\n", ptr[i].number);
}
}
}
|
C | #include<stdio.h>
void main(){
int a,b,c,l;
printf("输入三个整数");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
l=a;
a=b, b=l;
}
if(a>c){
l=a;
a=c,c=l;
}
if(b>c){
l=b;
b=c,c=l;
}
printf("%d,%d,%d",a,b,c);
}
|
C | #include<stdlib.h>
#include<stdio.h>
#include<string.h>
#define TUPLE_SIZE 6
void usage() {
fprintf(stderr, "vox2txt <input_filename> <output_filename>\n");
}
int main(int argc, char** argv) {
FILE *file_in = NULL, *file_out = NULL;
int num_tuples = 0, read, written, size = TUPLE_SIZE;
char buffer[TUP... |
C | #include<stdio.h>
void cmpnum(int num1, int num2);
int main() {
int num1, num2;
scanf_s("%d %d", &num1, &num2);
cmpnum(num1, num2);
getchar(); getchar();
return 0;
}
void cmpnum(int num1, int num2) {
num1 = ((num1 % 10) * 100) + ((num1 % 100 / 10) * 10) + (num1 / 100);
num2 = ((num2 % 10) * 100) + ((num2 %... |
C | #include <ae/pool.h>
#include <sys/mman.h>
#include <unistd.h>
#include <ae/log.h>
#include <ae/try.h>
#include <stdio.h>
#define ALIGN_PTR(p, a) \
(uint8_t *) (((uintptr_t) (p) + ((uintptr_t) a - 1)) & ~((uintptr_t) a - 1))
bool ae_pool_uninit(ae_res_t *e, ae_p... |
C | /*
. 빮ڸ ϸ ҹڷ ȯؼ ϴ toLower Լ
ҹڸ ϸ 빮ڷ ȯؼ ϴ toUpper Լ Ͻÿ.
*/
#include <stdio.h>
void toLower(char ch) {
if ( ch < 'A' || ch > 'Z') {
printf("빮ڰ ƴϱ ȯ ϴ.\n");
return;
}
printf("빮 %c ҹڷ %cԴϴ.\n", ch, ch+32);
}
void toUpper(char ch) {
if (ch < 'a' || ch > 'z') {
printf("ҹڰ ƴϱ ȯ ϴ.\n");
return;
}
pr... |
C | #include "nm.h"
static t_options_map g_waiting_value_options[] = {
{ NULL, 0, NULL },
};
/*
** Return 1 when the argument name is an option like -l or -lR
** Return 0 when the argument name is an option like --reverse
*/
bool is_a_single_option(const char *name)
{
if (name[0] == '-' && name[1] != '-')
return (... |
C | /* mc_sequence.c */
#include <jd_pretty.h>
#include <string.h>
#include <stdlib.h>
#include "mc_sequence.h"
#include "mc_util.h"
static const char *mc_sequence_sym_num =
"0123456789";
static const char *mc_sequence_sym_alnum =
"abcdefghijklmnopqrstuvwxyz"
"0123456789";
static void with_format(const char *fm... |
C | #pragma once
/**
* @file queue.h
* @author Scott Newman
*
* @brief A queue data structure.
*
* A generic queue data structure that uses previous and next pointers in
* a linked list. All data put on the queue is appended to the back and all
* data removed from the queue is removed from the front. This means th... |
C | #include <stdio.h>
#include <stdlib.h>
#include "stack.h"
/*
1. Declaration can be done any number of times but definition only once.
2. “extern” keyword is used to extend the visibility of variables/functions().
3. Since functions are visible through out the program by default. The use of extern is not needed in funct... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_iterative_power.c :+: :+: :+: ... |
C | #include <stdio.h>
void main()
{
int num, t, r, rev = 0;
printf("Enter an integer \n");
scanf("%d", &num);
t = num;
while (num > 0)
{
r = num % 10;
rev = rev * 10 + r;
num /= 10;
}
printf("Given number is = %d\n", t);
... |
C | // WAP to take five names as input and print those names in ascending order
// based on the first character of each name.
#include <stdio.h>
#include <string.h>
int main()
{
int i, j, num;
char name[20][10], t_name[15][10], temp[20];
printf("Please enter how many number of names to be sorted... |
C | #include "holberton.h"
/**
* _strncpy - a copy of string
* @dest:the returns
* @src: pointer
* @n: config
*
* Return: the parameter dest.
*/
char *_strncpy(char *dest, char *src, int n)
{
int i;
i = 0;
while (i < n && src[i] != '\0')
{
dest[i] = src[i];
i++;
}
i = i;
while (i < n)
{
dest[i] = '\0';
i++;
}
retur... |
C | #include <stdio.h>
#include <stdlib.h>
/* This program demonstrates how to use function pointers.
For an explanation of function pointers, see page 118
in the K & R book. */
int *
f1 ()
{
printf ("Inside f1\n");
// dynamically allocate a single int on the heap
// for an explanation of the heap and dynami... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "config.h"
#include "image.h"
#include "homomorf.h"
typedef struct _Options {
char *conf_file;
int no_gui;
int time;
} Options;
int run(const Config *config, const Options *options) {
Image *input = read_image(config->input_filename, ... |
C | //-----------------------------------------------------------------------------
/*
STDIO to LCD Terminal Functions
*/
//-----------------------------------------------------------------------------
#include <string.h>
#include "lcd.h"
//-----------------------------------------------------------------------------
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "multi_param.h"
PARAM_CONTAINER* split_args(int argc, char** argv, char** subparam_order, int subparam_count) {
int i, j, last_subarg = NO_MATCH;
PARAM_CONTAINER* param_container;
SUBARG_MATCH current_match = {
.argv = NULL,
.index =... |
C | #pragma once
//============
//Float2
//============
struct Float2
{
Float2()
:x{}, y{} {};
Float2(float X, float Y) :x{X}, y{Y}{}
void operator++()
{
++x;
++y;
}
void operator--()
{
--x;
--y;
}
void operator+=(const Float2 rhs)
{
x += rhs.x;
y += rhs.y;
}
void operator-=(const Float2 rhs)
{... |
C | /*****************************************************************/
/* Class: Computer Programming, Fall 2019 */
/* Author: 林天佑 */
/* ID: 108820003 */
/* Date: 2019.11.18 ... |
C | /*
SYNOPSIS
Part of solution for excercise 59-01. See 59-01.c to get more information.
AUTHORS
Kevin Leptons <kevin.leptons@gmail.com>
*/
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <signal.h>
#include <string.h>
#incl... |
C | #include <stdio.h>
#include <stdlib.h>
void main()
{
double fno,sno,*ptr1=&fno,*ptr2=&sno;
printf(" Input the first number : ");
scanf("%lf", ptr1);
printf(" Input the second number : ");
scanf("%lf", ptr2);
if(*ptr1>*ptr2)
{
printf("\n\n %lf is the maximum number.\n\n",*ptr1);
}
else
{
printf("... |
C | #include <stdio.h>
#define SIZE 10
void sel_sort(double arr[], int size);
int main()
{
double arr[SIZE];
int i = 0;
while(i < SIZE)
{
printf("arr[%d] : ", i);
while(scanf("%lf", arr + i) != 1)
{
printf("\n");
while(getchar() != '\n');
}
... |
C | #include<stdio.h>
#include<conio.h>
main()
{
int i,sum,n,j;
printf("enter the number");
scanf("%d",&n);
for(j=2;j<=n;j++)
{
sum=0;
for(i=2;i<=j;i++)
{
if(j%i==0)
sum++;
}
if(sum<2)
printf("%d\t",j);
}
}
|
C | //实现孤儿进程
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
int main()
{
pid_t id = fork();
if(id < 0)
{
perror("fork");
return 1;
}
else if(id == 0)
{
printf("I am a child,pid: %d\n",getpid());
sleep(10);
}
else
{
... |
C | /*
* VnetCard: Signal
*
* (C) 2019.05.14 <buddy.zhang@aliyun.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h... |
C | #include <stdio.h>
#define MAX_LENGTH 500
int main()
{
int i;
char test[MAX_LENGTH];
for (i = 0; i < MAX_LENGTH - 1 ; i++) {
test[i] = ' ';
}
// in progress
return 0;
} |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int occurences(char ch, const char* pwd);
int is_valid_p1(int min, int max, char ch, const char* pwd);
int is_valid_p2(int pos1, int pos2, char ch, const char* pwd);
int main()
{
int num1, num2, valid1 = 0, valid2 = 0;
char character, password[256];
... |
C | #include <stdio.h>
#include <stdlib.h>
struct elemento {
int info;
struct elemento *next;
};
typedef struct elemento ElementoDiLista;
void inserisci(ElementoDiLista **lista, int el);
void intersezione(ElementoDiLista **lista1, ElementoDiLista **lista2, ElementoDiLista **lista3);
void stampa_lista(ElementoDiLista ... |
C | #include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
// 0-read
// 1-write
int main(int argc, char const *argv[])
{
int pipefd1[2];
int pipefd2[2];
pid_t cpid;
char buf;
char path[50];
char readbuffer[50];
FILE *fp;
pi... |
C | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
void* count_numbers(void* args)
{
for (int i = 0; i < *((int*)args); ++i) {
printf("Thread ID: %d ", (int)pthread_self());
printf("i: %d\n",i);
}
return NULL;
}
int main(void)
{
clock_t start, end;... |
C | #include <stdio.h>
#include <ctype.h>
int main(void)
{
int ch;
int num=0,count=0;
while((ch=getchar())!=EOF)
{
if(isdigit(ch))
num++;
if(isalpha(ch))
count++;
}
printf("num~%d,count~%d\n",num,count);
return 0;
}
|
C | #include <stdio.h>
int main(void){
float km, litros;
printf("Digite a quantidade de Km percorrido e litros consumido\n");
scanf("%f %f", &km ,&litros);
if (km/litros <= 5){
printf("O consumo e' ruim");
}
else if (km/litros <= 8){
printf("O consumo e' razoavel");
}
els... |
C | #include <string.h>
#include "qry_utility_functions.h"
#include "block.h"
#include "resident.h"
#include "wrapper.h"
void loc_print(People_t person, Lease_t property, FILE *qrySVGFile, double x){
if(person != NULL){
fprintf(qrySVGFile, "\t<text x=\"%.2f\" y=\"%.2f\">Nome e sobrenome: %s %s, sexo: %c, cpf:... |
C | /*
INTEGRITY STATEMENT (modify if neccessary)
I received help from the following sources: None.
I am the sole author of this work .
Sign this statement by removing the line below and entering your name
Name: Chenzheng Su
login ID: c28su
*/
#include <string.h>
#include "fun-with-strings.h"
// is_palin... |
C | #include "glf/math.h"
#include <stdio.h>
#include <assert.h>
#define AT(m, _i, _j) m[(_i) * 4 + (_j)]
static float identity[16] = {1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0};
void glf_mat_set_identity(float *m)
{
int i = 0;
for (i = 0; i < 16; i++) {
m... |
C | /*
** my_str_to_wordtab.c for my_str_to_wordtab in /home/thibrex/delivery/CPool_Day08
**
** Made by Thibaut Cornolti
** Login <thibaut.cornolti@epitech.eu@epitech.net>
**
** Started on Wed Oct 12 11:08:17 2016 Thibaut Cornolti
** Last update Fri Nov 25 14:54:04 2016 Thibaut Cornolti
*/
#include <stdlib.h>
#includ... |
C | #ifndef RECORD_H
#define RECORD_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define IDSIZE 10
#define NAMESIZE 20
#define LINESIZE 512
/*
* Name: Jason Chen
* Date: March 20, 2017
*/
/*************************************************************************************
* Each record consist... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
char command[80] = "date +%A";
char name[32];
printf("Enter your nickname: ");
gets(name);
printf("Hi, %s. Today is: ", name);
//fflush(stdout);
printf("command: %s", command);
fflush(stdout);
system(command);
return 0;
}
|
C | #include "graphs.h"
#include <stdio.h>
int vertex_marked(vertex_t *vertex, size_t indices[], size_t i);
size_t depth(vertex_t *v, size_t marked[], size_t depth, size_t *max,
void (*action)(const vertex_t *v, size_t depth));
size_t *max_depth(size_t *depth, size_t new_depth);
size_t depth_first_traverse(const graph_t ... |
C | #include<stdio.h>
#include<string.h>
int main(void)
{
int i;
int len;
int joi, ioi;
char str[100000];
memset(str,'\0',sizeof(str));
while (scanf("%s", str) != EOF){
joi = 0;
ioi = 0;
len = strlen(str);
for (i = 0;i < len - 2;i++){
if (str[i] == 'J' && str[i+1] == 'O' && str[i+2] == 'I'){
j... |
C | #include <stdlib.h>
#include <errno.h>
#include "limitmalloc.h"
#define limit limitmalloc_private_limit
#define via limitmalloc_private_via
#define allocated limitmalloc_private_allocated
void *limitmalloc_open(limitmalloc_pool *p,int64 len)
{
void *result;
limitmalloc_pool *q;
if (len < 0) { errno = ENOMEM; re... |
C | #include <stdio.h>
#ifndef OBJSTORE_H_
#define OBJISTORE_H_
//funzione che ha lo scopo di tokenizzare i messaggi di reesponso delle operazioni dal server e ritorna un booleano
int checkResult(char *buff);
//funzione che ha lo scopo di registrare un utente di nome "name" all'objectStore
int os_connect(char *name);
//fu... |
C | #ifndef ENDIAN_IMPORTED
#define ENDIAN_IMPORTED
#include <stdint.h>
#include <limits.h>
#if CHAR_BIT != 8
#error "unsupported char size"
#endif
union uint48_t {
char c[6];
uint64_t v:48;
};
int is_little_endian()
{
union {
uint32_t i;
char c[4];
} u = {0x01020304};
return u.c[0... |
C | /* Given three char, the program should print them rearranged per their corresponding ASCII Code */
#include <stdio.h>
void sortF(char , char , char );
int main() {
char a = '0', b = '0', c = '0';
char option = '0';
printf("\n Welcome. Easy as ABC operates with ASCII Code to rearrage any three character... |
C | #include <stdio.h>
#include <stdlib.h>
#define IDENT 1
#define OP +
typedef struct{
long len;
int *data;
// vec_ptr 作为vec_rec的指针
}vec_rec,*vec_ptr;
// 创建一个向量 并且明确长度
vec_ptr new_vec(long len){
// 申请空间
vec_ptr result = (vec_ptr) malloc(sizeof(vec_rec));
int *data = NULL;
if(!result)
r... |
C | #include <allegro.h>
#include <stdio.h>
#include "game.h"
#include "directionVariables.h"
// Initialise the game
Game* initGame(){
Game *game = malloc(sizeof(Game));
game -> snakeHead = initSnake();
game -> field = initMap(1);
game -> apple = placeApple(game -> snakeHead, game -> field);
game -> sc... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
int main(){
/*int a[10];
int *p = a;*/
//*(p+3) == a[3]
int n;
int *b;
scanf("%d", &n);
b = malloc(sizeof(int)*n);
printf("type the num");
scanf("%d", &b[2]); // = scanf("%d", b + 2);
printf("%d",b[2]);
free(b);
//... |
C | /***************************************************************************
*
* dksetup.c -- This file contains functions that set up a duplicate key
* index structure based on a unique-key index structure.
*
***************************************************************************/
#include <stdl... |
C | /*
* *******************************************************************************
Paula Dwan
13208660 : COMP40730 : Assignment 4
MPI program computing norm of product of two nxn matrices
1/ Granularity of the product :
(ii) One step algorithim. No intermediate resulting matrix... |
C | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <float.h>
#include <stddef.h>
#include "common.h"
#include "body.h"
#include "cell.h"
#include "darray.h"
#include "orb.h"
#define MASTER 0
#define MAX_LINE_LENGTH 1024
void get_universe_size(vect... |
C | #include<stdio.h>
int main(void) {
int num, n, i, sum = 0;
printf(" Է : ");
scanf_s("%d", &num);
for (n = 2; n <= num; n++) {
for (i = 2; i < n; i++) {
if (n%i == 0)
break;
}
if (n == i)
sum += n;
}
printf("%d", sum);
return 0;
} |
C | #include <stdio.h> /* printf */
#include "utstring.h"
int main()
{
UT_string *s,*t;
char a[] = " text";
utstring_new(s);
utstring_new(t);
utstring_printf(s,"hello %s", "world");
printf("%s\n", utstring_body(s));
utstring_bincpy(s,a,sizeof(a)-1);
printf("%s\n", utstring_body(s));
... |
C | #include <stdio.h>
#include <dlfcn.h>
#include <unistd.h>
static void *dl;
FILE *(*orig_fopen)(const char *, const char *);
__attribute__((constructor)) void stub(void)
{
dl = dlopen("/lib/libc.so.6", RTLD_LAZY | RTLD_GLOBAL);
orig_fopen = dlsym(dl, "fopen");
}
FILE *fopen(const char *path, const char *mode)
{
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/sha.h>
#include <openssl/md5.h>
#include <openssl/crypto.h>
typedef struct sid_node{
unsigned char l_nid[16];
unsigned char l_sid[20];
unsigned char nid[16];
struct sid_node *next;
}sid;
void mymd5(unsigned char *buff,unsigned char *md... |
C | /*
** EPITECH PROJECT, 2018
** BSQ.h
** File description:
** made by Loris D
*/
#ifndef __BSQ_h__
#define __BSQ_h__
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
typedef struct square_s
{
int x;
int y;
int max;
}square_t;
void val(square... |
C | //
// arrays.c
//
//
// Created by Irwan on 8/1/19.
//
//
#include <stdio.h>
#include <stdlib.h>
#define MONTHS 12
int main(void){
float expenses[] = { 10.3, 9, 7.5, 4.3, 10.5, 7.5, 7.5, 8, 9.9, 10.2, 11.5, 7.8 };
int count, month;
float total;
for (month=0, total=0.0; month < 12; month... |
C | #include "switch.h"
/*
* Initialize pin as switch (input)
*/
void switch_init(PIN p)
{
pdir_in(p); // Set as input.
p_ren(p); // Enable resistor.
p_high(p); // Set to Pull-up mode (high).
}
/*
* Initialize switch with interrupts enabled
*/
void switch_initwie(PIN p)
{
switch_init(p);
p_ie(p... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float a,b, resposta;
double c;
printf("Entre com o primeiro lado, com o segundo lado e com o valor do angulo: \n");
scanf("%f, %f, %lf", &a, &b, &c);
resposta=sqrt(pow(a,2)+pow(b,2)-2*a*b*cos(c));
printf("Lado = %g", resposta)... |
C | #include "search_algos.h"
/**
* binary_search_recursion - recursive search through the binary search
* @array: pointer to the front of the array
* @front: the front of the array
* @end: the end of the array
* @value: value to search for
*
* Return: index if found, -1 if not found, and -2 if error is caught
*/
i... |
C | /*
XbhǗ
*/
#ifndef trd_mngH
#define trd_mngH
#include "sys_def.h"
#define TRD_NON 0 // Xbhs
#define TRD_SPD 1 // TXyh
#define TRD_RUN 2 // s
typedef struct { // XbhǗʍ
HANDLE trd; // Xbhnh
DWORD tid; // Xbhhc
HANDLE stt; // XbhNCxg
HANDLE stp; // ~w߃Cxg
HANDLE stc; // ~Cxg
... |
C | #include<stdio.h>
#include<string.h>
int main(){
int n;
scanf("%d",&n);
int i;
char num[100];
for(i=0;i<n;++i){
scanf("%s",num);
int l=strlen(num);
int j;
for(j=0;j<l;++j){
if((l-j)%3==0 && j!=l-1 && j!=0){
putchar(',');
... |
C | #include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include "List.h"
List* List_Create()
{
List* list = (List*)malloc(sizeof(List));
if(NULL == list) {
return NULL;
}
list->node = NULL;
return list;
}
void List_Destory(List* list)
{
}
BOOL List_isEmpty(List* list)
{... |
C | /*! \mainpage TransitSim: Main Page
*
* \section intro_sec Project Overview
*
* The goal of this software project is to develop a
* rudimentary transit simulator in which simulations can be controlled via
* external configuration (without code change) and be visualized within a
* graphics window.
*
* This is a... |
C |
/*********************************************************************
** @file led.c
** @date 2018/8/8
** @author adong
** @brief None
*********************************************************************/
/*----------------------------ͷļ----------------------------*/
#include "led.h"
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <arpa/inet.h>
#define BUFLEN 1500
int main(int argc, char ** argv) {
int sd_udp, sd_tcp, rw;
stru... |
C | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
double count=0;
void insertion_sort(int *arr,int n){
int i,v,j;
for(i=1;i<n;i++){
v=arr[i];
j=i-1;
while(j>=0 && arr[j]>v){
arr[j+1]=arr[j];
j--;
count++;
}
arr[j+... |
C | //
// bmpDistortion.c
// hw0303
//
// Created by michaelleong on 23/04/2021.
//
#include "bmpDistortion.h"
#include <string.h>
#include <math.h>
#include <stdlib.h>
int bmpDistortion() {
char fileName1[129] = {0};
char fileName2[129] = {0};
FILE *pFile = NULL;
FILE *pFile2 = NULL;
int angle = 0... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "./dbg.h"
#define LOGLIST "/home/sumeet/.config/logfind/loglist"
void Die(const char *message);
int IsContain(const char *str, const char *contain);
int CheckForArgs(int argc, char **argv, char *str);
int main(int argc, char *argv... |
C | #include "worldOfWalls.h"
int ini_first_pos(t_window *wind, int i, int x, int y)
{
int ymax;
ymax = y_max_map(wind->map) - 1;
while (wind->map[i] != '\0')
{
if (wind->map[i] == '0')
{
wind->coord->p_x0 = x + 0.5;
wind->coord->p_y0 = ymax - y + 1 + 0.5;
return (0);
}
if (wind->map[i] =... |
C | ////////////////////////////////////////////////////////////////////////////////
/// Copyright (c) 2018-2019 Fabian Zahn - 0xFAB
/// See provided LICENSE file for more information
////////////////////////////////////////////////////////////////////////////////
#include <stdint.h>
#include "clock.h"
#include "delay.h"... |
C | /*
Author: Ryan Camp
Purpose: To learn about for loops in C language
Date: 10-25-2020
*/
/*
NOTES:
For Loop:
- pre-test loop, continuation is tested before beginning loop.
for(start_condition; continuation_condition; action_per_iteration) {
loop_statement;
}
- counter control loop
- s... |
C | #include <code_gen/mmap-sub.h>
#include <code_gen/mmap-util.h>
#include <basic/Exit.h>
namespace omega {
#if ! defined DONT_QUIT_FOR_FAILED_SUBSTITUTION
#define DONT_QUIT_FOR_FAILED_SUBSTITUTION (getenv("DONT_QUIT_FOR_FAILED_SUBSTITUTION") ? atoi(getenv("DONT_QUIT_FOR_FAILED_SUBSTITUTION")) : 0)
#endif
// informati... |
C | #include<stdio.h>
#include<stdarg.h>
int myprintf(char* string,...){
va_list arg;
va_start(arg,string);
char *ch=string,*temp;
for(;*ch!='\0';ch++){
if(*ch=='%'){
ch++;
switch(*ch){
case 'd':
printf("%d",va_arg(arg,int));
break;... |
C | #include<stdio.h>
main()
{
int pid,a=10;
pid=fork();
/*printf("%d\n",pid);
//printf("%d\n",pid());
printf("hello world\n");*/
if(pid==0)
{
while(1)
{
printf("in child a :%d\n",a);
a++;
// sleep(1);
}
}
else
{
while(1)
{
sleep(2);
printf("in parent a:%d\n",a);
... |
C | /* Exercice 1 : Files IPC SERVEUR
Usage : ./serveur.e
Serveur de réaliation d'opérations algèbriques.
Reçoit des requètes de clients sous forme de messages de file IPC et y réponds de la même manière
la file de communication est instancié par le serveur et proprement détruite à la fin de son execution
Etudiant... |
C | /*
Group- 35
2017A7PS0082P Laksh Singla
2017A7PS0148P Kunal Mohta
2017A7PS0191P Suyash Raj
2017A7PS0302P Shubham Saxena
*/
#include "terminal_hash_map.h"
hash_map *create_terminal_hash_map(int num_buckets)
{
hash_map *hm = create_hash_map(num_buckets);
int *temp;
temp = calloc(1, sizeof(int));
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <wiringPi.h>
#include <wiringSerial.h>
#include <unistd.h>
char device[] = "/dev/rfcomm0";
int fd = 0;
unsigned long baud = 9600;
//unsigned long time = 0;
void setup(){
printf("%s \n","Raspberry Startup!");
fflush(stdout)... |
C | /*
a) mando più ping incrementando di volta in volta il payload dell'icmp. Setto il flag Don't fragment del pacchetto ip.
Appena vedo che ad una certa dimensione del payload non ricevo più la echo response, questo significa che il pacchetto è stato scartato
in quanto la dimensione è troppo grande e tale pacche... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "graphics.h"
#include "image.h"
hyp_window* init_window(void) {
struct hyp_window* hwnd = malloc(sizeof(struct hyp_window));
if(hwnd == NULL)
return NULL;
Display *display = XOpenDisplay(NULL);
if(displa... |
C | #include<stdio.h>
#include "heap.h"
// gcc main.c heap.c -lm
int main(int argc,char** argv){
char line[LINE_LENGHT];
int n, *arr;
printf("Lettura del file %s\n",argv[1]);
//apertura del file il cui nome è passato in linea di comando
FILE* fin = fopen(argv[1],"r");
if(fin == NULL ) goto endo;
//c... |
C | #include<omp.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int mat1[3][3] = { {1, -5, 3}, {2, -9, 0}, {-6, 7, 8} };
int mat2[3][3] = { {5, 8, -9}, {6, 0, -1}, {2, -3, 4} };
int n=3;
int i,j;
int add[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
int sub[3][3] = { {0, 0, 0}, {0, 0, 0}, {0, 0... |
C | /*
* File: main.c
* Author: Felipe Costa
*/
/*Cap3, ex14, resolvido*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
printf("\n\t**CALCULA A IDADE DA PESSOA**");
//declaração de variaveis
int anoNasc, anoAtual, idade, idade2050;
//recebe dados
pr... |
C | #include<stdio.h>
int main()
{
int n,arr[101],i,array[101];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
array[arr[i]-1]=i+1;
}
for(i=0;i<n;i++)
printf("%d ",array[i]);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
void odwroc(int n,int tab[])
{
int temp;
for(int i=0; i<n/2; i++ )
{
temp = tab[i];
tab[i] = tab[n-1-i];
tab[n-1-i] = temp;
}
}
void wyswietl(int n, int tab[])
{
for(int i=0; i<n; i++)
{
printf("%d", tab[i]);
}
pri... |
C | /*
** EPITECH PROJECT, 2020
** B-PSU-210-PAR-2-2-42sh-victoire.rabeau
** File description:
** path_finding
*/
#include "shell.h"
static int check_key(char const *to_find, char *env)
{
size_t res = 0;
for (size_t i = 0; i != strlen(to_find); i++)
if (to_find[i] == env[i])
res++;
return... |
C | #include<stdio.h>
#include<string.h>
char s[100][100],v;
int i,j,m,n,result;
main()
{
printf("enter number of rows and columns of a matrix");
scanf("%d%d",&m,&n);
scanf("%c",&v);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%c",&s[i][j]);
}
scanf("%c",&v);
}
result=grid(0,0,s);
printf("%d",result);
}... |
C | #include <stdio.h>
#include <time.h>
int main(void)
{
printf("char %ld\n", sizeof(char));
printf("short %ld\n", sizeof(short));
printf("int %ld\n", sizeof(int));
printf("long %ld\n", sizeof(long));
printf("float %ld\n", sizeof(float));
printf("double %ld\n", sizeof(double));
printf("pointer %ld\n"... |
C | // Program to print nth Fibonacci number. 0 1 1 2 3 5 8 13 21…….
// Input: n=7
// Output: 8
#include <stdio.h>
#include <stdlib.h>
int fib(int n){
int x=0,y=1,z=x+y;
int a[n];
a[0]=0;a[1]=1;
int n1=2;
while(n1<=n){
z=x+y;
x=y;
y=z;
a[n1]=z;
n1++;
}
return a[n-1];
}
void main(){
int n;
printf("Enter ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* put_first_adjacency.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
typedef struct{
int arr[10][10];
}rand_arr;
rand_arr retArr(){
rand_arr result;
srand((unsigned)time(NULL));
int row, col;
for(row=0;row<10;row++){
for(col=0;col<10;col++){
int number = rand()%100;
result.arr[row][col]=numb... |
C | #include <stdio.h>
#include <string.h>
int main() {
char c = 'a';
char str1[27];
for (int i = 0; i < 27; i++)
{
str1[i] = c;
c++;
}
str1[26] = '\o';
char str2[] =
"abcdefghijklmnopqrstuvwxyz";
if(strcmp(str1,str2) == 0)
{
printf("The alphabets are identical.\n");
}
for (int i = 0; i < 26; i++)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.