language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #define _POSIX_C_SOURCE 200809L
#define _XOPEN_SOURCE 700
#include<stdio.h>
#include<unistd.h>
#include<time.h>
#include<signal.h>
#include<stdarg.h>
#include<string.h>
#include<setjmp.h>
#include<sched.h>
#define SEC_TO_NANO 1000000000
#define MILLI_TO_NANO 1000000
#define MICRO_TO_NANO 1000
#define MILLI 1000
#def... |
C | #include <stdio.h>
int main(void)
{
int a = 0x12345678;
char *p = (char *)(&a);
if (*p == 0x78) {
printf("Little-Endian!\n");
} else if (*p == 0x12) {
printf("Big-Endian!\n");
} else {
printf("other!\n");
}
return 0;
}
|
C | /*************************************************************************
> File Name: bruteforce.c
> Author: gpx
> Mail: 1457495424@qq.com
> Created Time: 2019年01月01日 星期二 09时46分56秒
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
int BruteForce(ch... |
C | #include "uthread.h"
#include "types.h"
#include "user.h"
#define T_A_DEBUG 0
static int k_stat = 0;
void
thread_do() {
int s_i, s_tid;
s_tid = uthread_self().tid;
for (s_i=0; s_i<k_stat; s_i++) {
DEBUG_PRINT(3, "inside thread %d", s_tid);
printf(2, "thread %d iteration %d\n", uthread_sel... |
C | #include <pthread.h>
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
pid_t p1_pid,p2_pid,p3_pid,p4_pid,p5_pid;
int pip13[2];
pipe(pip13);
char buffer[100];
if ((p1_pid = fork())== 0) {
dup2(pip13[1],1);
close(pip13[0]);
pr... |
C | #include <stdio.h>
#include <stdbool.h>
#include <math.h>
#include "geometry.h"
bool is_intersect(line_t *l1, line_t *l2) {
double cp1 = (l1->p2.x - l1->p1.x) * ((l2->p1.y) - (l1->p1.y)) -
((l1->p2.y - l1->p1.y) * ((l2->p1.x) - (l1->p1.x)));
double cp2 = ((l1->p2.x - l1->p1.x) * (l2->p2.y - l1... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
/*
34. Ler os dados pessoais de um conjunto de
candidatas de um concurso de beleza e escrever
os nomes daquelas que tm altura maior que 1,70m.
Os dados pessoais so:
nmero da inscrio, nome completo, altura,
peso, naturalidade e es... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* color_parser.c :+: :+: :+: ... |
C | #ifndef _SEARCH_ALGOS_H_
#define _SEARCH_ALGOS_H_
#include <stddef.h>
/**
* struct listint_s - simple linked list nodes
* @n: value in this node
* @index: index in the list
* @next: pointer to next node in the list
*/
typedef struct listint_s
{
int n;
size_t index;
struct listint_s *next;
} listint_t;
/**
*... |
C | #include "Real.h"
//******************************************************************************************
// Real - class used to manage real numbers. Includes methods to unpack half/single/double
// precision numbers into a 'real' (64 bits worth of binary digits with sign and
// decimal place).
//
... |
C | /* *********************************** */
/* */
/* Morphosis project */
/* */
/* Created by Artur Makhnach */
/* github.com/DippyArtu */
/* artum.me */
/* ... |
C | #include <stdio.h>
main(int argc,char **argv)
{
int i;
for(i=1;i<atoi(argv[1]);i++)
printf("%03d\n",i);
}
|
C | /**
@file orbit.h
@brief Main header for the photodynamical routines.
*/
#include <stdio.h>
#include <math.h>
// Constants
#define BIGG 0.00029591220363 /**< Gravitational constant (AU^3 / MSUN / day^2) */
#define PI 3.14159265358979323846
#d... |
C | /* Author: gturr001, Giovany Turrubiartes
* Partner(s) Name:
* Lab Section:
* Assignment: Lab #8 Exercise #1
* Exercise Description: [optional - include for your own benefit]
*
* I acknowledge all content contained herein, excluding template or example
* code, is my own original work.
*/
#include <avr/io.h>
... |
C | #include "ngx_core.h"
// compile with ``gcc main.c ngx_alloc.c ngx_palloc.c -o scaffold``
int main() {
ngx_init_mem_params();
printf("memory allocation test: \n");
const char* s1 = "hello world";
const char* s2 = "hello world";
void* p = ngx_alloc(20);
memcpy(p, s1, strlen(s1));
printf("p... |
C | #pragma once
#include <stdbool.h>
#include "board.h"
typedef void *T;
#define check_pointer(p) \
if (!p) { \
printf("Out of memory."); \
exit(EXIT_FAILURE); \
}
/**
* An element of a linked list
* */
typedef struct list_element {
struct list_element *next; ///< Po... |
C |
int main (){
int year1,month1,day1,year2,month2,day2;
int total=0;
scanf("%d %d %d",&year1,&month1,&day1);
scanf("%d %d %d",&year2,&month2,&day2);
while((year1!=year2)||(month1!=month2)||(day1!=day2)){
if(month1==1||month1==3||month1==5||month1==7||month1==8||month1==10){
if(day1<31){
day1++;
total++;... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#define BUFFER_SIZE 4096
#define MAX_EPOLL_EVENTS 1024
#define SERVER_PORT 8888
typedef int (*NCALLBACK)(int so... |
C | /*
* Lcd.c
*
* Created: 9/13/2021 1:24:59 PM
* Author: Eslam Emara
*/
#include "Lcd.h"
ST_TIMER_config_t TimerConfig = {TIMER0,FREQ_1_MHZ,NORMAL_MODE}; /*Set the timer for delay configurations*/
/*
*Description: Function to initalize the connected LCD according to Config file
*Set your desired configuration... |
C | #include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
static uint32_t x = 123456789;
static uint32_t y = 362436069;
static uint32_t z = 521288629;
static uint32_t w = 88675123;
static uint32_t v = 886756453;
static uint32_t xorshift(void) {
uint32_t t;
t = x ^ (x >> 7);
x = y;
y = z;
z = w;... |
C | #include<stdio.h>
#include<unistd.h>
main()
{
pid_t pro_id;
pro_id = fork();
if(pro_id == 0)
{
printf("Child ID: %d Parent ID: %d \n",getpid(),getppid());
}
else if(pro_id > 0)
{
printf("Parent ID: %d Parent's Parent ID: %d \n",getpid(),getppid());
}
else printf("Fork... |
C | /*
برنامه ای بنویسید که آرایه ای از رشته ایجاد کند.
مثال :
{"apple", "banana", "peach", "lemon"}
سپس این رایه را بتوجه به طول رشته مرتب کند و در خروجی چاپ نماید.
*/
#include <stdio.h>
#include <string.h>
#define SIZE 4
#define STRING_MAX_SIZE 50
void initList(char listPtr[SIZE][STRING_MAX_SIZE]);
void sortByLengt... |
C | #include <stdio.h>
#include <stdlib.h>
#include <windows.h>
void merge(int arr[], int esq, int meio, int dir){
int i, j, k;
int a1 = meio - esq + 1;
int a2 = dir - meio;
int E[a1], D[a2];
for(i=0; i<a1;i++){
E[i] = arr[esq + i];
}
for(j=0; j < a2; j++){
D[j] = arr[meio + 1... |
C | #include <stdalign.h>
#include <stddef.h>
#include <stdio.h>
struct int_pair_s {
int x, y;
};
typedef struct int_pair_s int_pair;
struct has_padding {
int x;
int:1;
int y;
};
typedef struct { int a, b; } anon;
void entry (const unsigned sz, int buf[const]) {
// anonymous and nested anonymous s... |
C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#ifdef __cplusplus
extern "C" { // will be compiled as C, not C++ (no overrides etc.)
// but cannot be in C sources => #ifdef
#endif
double pi = 3.14159265358979323846;
float retfl(float a);
double retdbl(double a);
double fl2dbl(float a);
double obvod(double ... |
C |
/*
Limbus - A cross-platform multimedia library.
Written in 2014 by Jesper Oskarsson jesosk@gmail.com
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain worldwide.
This software is distributed without any warranty.... |
C | /*
** EPITECH PROJECT, 2017
** nnlib
** File description:
** Test the transpose function
*/
/* File created the 11/04/2018 at 13:05:48 by julian.frabel@epitech.eu */
#include <criterion/criterion.h>
#include "nn.h"
Test(nn_matrix_transpose, valid_matrix, .timeout=1)
{
float array[2][3] = {{1.2, 2.3, 3.0}, {0.4, 5.2... |
C | #include <stdio.h>
#include <stdlib.h>
typedef struct node {
int i;
struct node *next;
} listNode;
int searchList(listNode *head, int value);
int main()
{
int i, value;
listNode *cur, *head = NULL;/*INITIALIZE HEAD TO A NULL POINTER*/
printf("Enter a list of numbers, terminated by the value -1:\n"... |
C | #include <stdio.h>
struct Score
{
char name[20];
double kor, eng, total;
};
typedef struct Score Student;
int main()
{
Student s1, s2;
FILE* stream;
puts("1. Է : ");
fscanf(stdin, "%s", s1.name); // Է Ƽ ü
puts("2. , Է : ");
fscanf(stdin, "%lf %lf", &s1.kor, &s1.eng); // Է Ƽ ü
s1.total = s1.ko... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* helpers.c :+: :+: :+: ... |
C | #include "headers.h"
void ls(char * input_str, char * add_root)
{
long long int i,j,k,len,flag_l = 0,flag_a = 0,num_dirs=0,curr_dir=0,cnt=0,blocks=0;
char * token = strtok(input_str, " "),dirs[100][1000],add_curr_dir[1000];
struct dirent * file;
struct stat info;
struct passwd * passwd;
struct... |
C | #include "utils.h"
#include "peripherals/p_uart.h"
#include "peripherals/gpio.h"
void uart_send ( char c )
{
while(get32(PL011_UART_FR) & (1<<5)) { }
put32(PL011_UART_DR, c);
}
char uart_recv ( void )
{
while(get32(PL011_UART_FR) & (1<<4)) { }
return(get32(PL011_UART_DR)&0xFF);
}
void uart_send_string(char... |
C | #include<stdio.h>
# define N 5
int queue[N];
int front = -1;
int rear = -1;
void enqueue();
void dequeue();
void display();
int isEmpty();
int isFull();
void peek();
int main()
{
printf("IsEmpty -- %d\n",isEmpty());
printf("IsFull -- %d\n",isFull());
enqueue(10);
enqueue(20);
enqueue(30);
disp... |
C | #include <stdio.h>
int main()
{
char array[2][9] = {"WBWBWBWB","BWBWBWBW"};
for (int r = 0; r < 2; r++)
{
for (int c = 0; c < 8; c++)
{
printf("%c",array[r][c]);
}
printf("\n");
}
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include "../src/sorted_queue.h"
int cmp(const void *a, const void *b){
int a_val = *((int *)a);
int b_val = *((int *)b);
if (a_val>b_val) return 1;
else
if (a_val<b_val) return -1;
return 0;
}
int main(){
int a = 5;
int b = 6;
int c = 7;
int d = 1;
int e = 10;
s... |
C | /*
* mm.c
*
* NOTE TO STUDENTS: Replace this header comment with your own header
* comment that gives a high level description of your solution.
*
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include <stdint.h>
#include "mm.h"
#includ... |
C | #include "DDBLinkedList.h"
#include <stdio.h>
int main(int argc, const char * argv[]) {
List list;
ListInit(&list);
LInsert(&list, 4);
LInsert(&list, 5);
int data;
if (LFirst(&list, &data))
printf("num: %d \n", data);
if (LNext(&list, &data))
printf(... |
C | #include<stdio.h>
int main()
{
int n,i,j,temp;
printf("Enter the no of elements:");
scanf("%d",&n);
int a[n];
printf("Enter the elements: ");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++)
{
int min =i; //taking first element as min number;//
for(j=i+1;j<n;j++) //Normal Linear Sear... |
C | #include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/un.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <string.h>
#include <ctype.h>
#define BUF_SIZE 1000
#define BACKLOG 1
#define SOCKET_ERR -2
#define BIND_ERR -3
#define LISTEN_ERR -4
#define ACCEPT_ERR -5
void string_toupper(char... |
C | // 2.Write a program which accept number from user and return the count of odd
// digits.
// Input : 2395
// Output : 3
// Input : 1018
// Output : 2
// Input : -1018
// Output : 2
// Input : 8462
// Output : 0
#include "header.h"
int main()
{
int iNo=0;
int iRet=0;
printf("Enter number... |
C | /*
You are given a string representing an attendance record for a student. The record only contains the following three characters:
'A' : Absent.
'L' : Late.
'P' : Present.
A student could be rewarded if his attendance record doesn't contain more than one 'A' (absent) or more than two continuous 'L' (late).
You... |
C | /**
* replaceString(source,s1,s2);
* Function replace s1 in source with s2.
*/
#include <stdio.h>
#include <stdbool.h>
int findString(const char source[], const char search[]) {
int i = 0, j = 0;
while (search[0] != source[j] && source[j + 1] && source[0])
++j;
do {
if (search[i] != source[j + i])
... |
C | /*
* client_actions.c
*
* Written By:
* Naveed Ashfaq - #1003859559
* Yu Dong Feng - #1002587523
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <unistd.h>
#include <string.h>
#include "client_actions.h"
void print_intro() {
printf("\n=... |
C | #include "unsigned_short_int_array.h"
#include "unity.h"
#include "unity_fixture.h"
TEST_GROUP(UnsignedShortIntArrayTests);
UnsignedShortIntArray unsignedShortIntArray;
UnsignedShortIntArray otherUnsignedShortIntArray;
TEST_SETUP(UnsignedShortIntArrayTests) {
UnsignedShortIntArrayInitialize(&unsignedShortIntArra... |
C | #include "param.h"
#include "types.h"
#include "stat.h"
#include "user.h"
#include "fs.h"
#include "fcntl.h"
#include "syscall.h"
#include "traps.h"
#include "memlayout.h"
#include "tournament_tree.h"
#include "kthread.h"
#define STACK_SIZE 100
void trnmt_test(){
printf(1,"4 ttree starting\n");
trnmnt_tree* t... |
C | #include <stdio.h>
union test {
struct {
int part;
char* moji:
};
struct data_2 {
int part;
char* moji_moji;
};
};
int main(void) {
test_t test;
test.data_1_t.part = 15;
printf("%d\n",test.data_2_t.part);
return 0;
}
|
C | int factorial (int f)
{
int i;
int res = 1;
for (i = 0; i < f; i++) res *= i;
return res
} |
C | /*
** EPITECH PROJECT, 2019
** my_strncmp.c
** File description:
** strncmp
*/
int my_strncmp(char const *s1, char const *s2, int n)
{
int value = 0;
for (int i = 0; s1[i] != s1[n] && s2[i] != s2[n]; i++) {
if (s1[i] != s2[i]) {
value = s1[i] - s2[i];
return (value);
}
... |
C | #include <stdio.h>
#include <math.h>
int ft_recursive_power(int nb, int power)
{
if (power < 0)
return 0;
if (power == 0)
return 1;
return (nb * ft_recursive_power(nb, power - 1));
}
int main(void)
{
int num;
int power;
num = 5;
power = 0;
printf("Value 0 ^ 0 = %lf\n", pow(0.0, 0.0));
num = ft_recursive... |
C | #inlcude<stdio.h>
#include<string.h>
void main()
{
char s1[20],s2[20];
printf("Enter a string");
scanf("%s",&s1);
s2=strrev(s1);
printf("Rversed string is:%s",s2);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h> /* key_t, sem_t, pid_t */
#include <sys/shm.h> /* shmat(), IPC_RMID */
#include <errno.h> /* errno, ECHILD */
#include <semaphore.h> /* sem_open(), sem_destroy(), sem_wait().. */
#include <fc... |
C | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct queue {
struct queue* next;
struct queue* prev;
int value;
} q;
typedef struct HeadAndTail {
struct queue* head;
struct queue* tail;
int size;
} ht;
ht* CreateQueue() {
ht* creation = malloc(sizeof(ht));
creation->head = creation->ta... |
C | #include "solucion.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>
int main(int argc, char** argv) {
int x = 20;
pid_t pid;
pid=fork();
if (pid==0){
printf("soy el hijo\n calculo fibonacci de %d\n",x);
printf("guardo el valor calculado en archivo 'archivo'\n");
printf("fibonacci(%d) = ",x);
... |
C | struct TrieNode {
int val;
struct TrieNode* next[26];
};
/** Initialize your data structure here. */
struct TrieNode* trieCreate(void) {
struct TrieNode* t = calloc(1, sizeof(struct TrieNode));
}
/** Inserts a word into the trie. */
void insert(struct TrieNode* root, char* word) {
char* p = word;
stru... |
C | #include <stdio.h>
int main(void)
{
int a = 10, b = 20;
const int *pa = &a; // pa a Ų.
printf(" a : %d\n", *pa); // Ͽ a
pa = &b; // Ͱ b Ű Ѵ.
printf(" b : %d\n", *pa); // Ͽ b
a = 20; // a Ͽ ٲ۴.
printf(" a : %d\n", *pa); // ͷ Ͽ ٲ
ret... |
C | /*
* overflow.c
*
* Copyright (C) STMicroelectronics Limited 2003. All rights reserved.
*
* Queue thousands of distributed objects on a port and check that the
* transports never loses a message it has committed to transmitting.
*
* NOTE: this test sends a I've finished message as part of its control
* data. ... |
C | #include <stdio.h>
#include <stdlib.h>
int
main(int argc, char **argv)
{
FILE *input_file;
char line[1024];
double cv, dv, e, t, b, cv_from_file;
// double integral, derivada;
int st;
int num_time_lags;
int num_lines;
int i, j;
int num_train_samples, num_inputs;
double *input;
if (argc != 3)
{
fprintf(... |
C | /*************************************************************************
> File Name: test_execv.c
> Author:
> Mail:
> Created Time: Tue 28 Jul 2015 09:54:15 AM CST
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<errno.... |
C | #define bsize 8
const char *algorithms[5] = {"Classic", "Blocked", "SGEMM CBLAS", "SGEMM CUBLAS", "Strassen+CUBLAS"};
void StrassenAlgorithm(float *A, float *B, float *C, long nelem, long n, int depth, int nstop, cublasHandle_t &handle);
void errChkCUBLAS(cublasStatus_t s, const char *msg){
if(s != CUBLAS_STATUS... |
C | #include <stdio.h>
int main() {
char ar[] = "Pointer";
char *pi1, *pi2;
pi1 = &ar[0];
pi2 = &ar[5];
printf("%c %c Ÿ %dԴϴ\n", *pi1, *pi2, pi2 - pi1); // P e Ÿ 5Դϴ
return 0;
}
/*
ͳ ȵ ϴ.
ͳ ּҰ+ּҰ ̱ . ǹ̾
(Ϲ) Ͱ 迭 ٸ ҿ Ű ǹ̰ ִ.
*/ |
C | /*
* /sys/regexps.h
* Some useful regular expressions
*/
#ifndef _sys_regexps_h_
#define _sys_regexps_h_
/*
* The following macros define the regular expression that define the view
* of some frequent strings you might want to check for.
* Example: if (IS_REGEXP(x,REGEXP_FLOAT)) write("It is a float!\n");
*/
... |
C | #include "../include/line.h"
int main(int argc, char** argv)
{
char lines[argc+1][255];
predealLine(argc, argv, lines);
char* filename = lines[1];
char* findstr = lines[2];
char fileline[1024];
int linecnt = 1;
FILE *src = fopen(filename, "r");
while(!feof(src)) {
fgets(fileline, 1024... |
C | #include <stdio.h>
int main() {
setbuf(stdout, NULL);
int a, b;
printf("Enter A value: "); printf("\n"); fflush(stdout); /**/
scanf("%d", &a);
printf("Enter B value: "); printf("\n"); fflush(stdout); /**/
scanf("%d", &b);
if (a % b == 0) {
printf("divisible"); printf("\n"); fflush(std... |
C | #include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "myCLib.h"
uint8_t simple_function(void) {
static int counter = 0;
counter++;
return counter;
}
uint8_t add_one(uint8_t value) {
return value + 1;
}
void add_one_to_string(char *input) {
p... |
C | #include"look.h"
void look_same_tip(pSword pshead)
{
printf("sum:%d\n",pshead->num);
//遍历每个相同单词
pSword ptmp = pshead;
int ftmp = 0;
while(ptmp->next!=pshead)
{
if(ptmp->next->file_no!=ftmp)
{
printf("(%d;%d;",ptmp->next->file_no,ptmp->next->num+1);
ftmp=ptmp->next->file_no;
}
printf("<%d>",ptmp-... |
C | #include <stdio.h>
#define MAX_N 100
#define MAX_M 500
typedef struct{
int A[MAX_N][MAX_M];
int n,m;
}Graph;
void init_graph(Graph *G,int n,int m){
G->m=m;
G->n=n;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
G->A[i][j]=0;
}
}
}
void add_edge(Gr... |
C | #include "sort.h"
/**
* partition - set the pivot of the sub sort for the Lomuto algorithm
* @array: an array of integers
* @size: size of the array
* @left: first index in the array to sort
* @right: the last index in the array to sort
*
* Return: No value returned.
*/
int partition(int *array, size_t size, ... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<malloc.h>
#include<conio.h>
#define MaxVertexNum 100//Ϊ100
#define N 4000 //涨ĸߴΪ40000
struct close
{
int adjvex;
int lowcost;
};
struct close closedge[MaxVertexNum];
typedef char VertexType;//Ϊַ
typedef int EdgeType;//ߵȨֵΪ
typedef struct
{
VertexT... |
C | /**
* @file VS1053.c
* @brief code for the SABT audio codec
* @author Nick LaGrow (nlagrow)
* @author Alex Etling (petling)
* @author Kory Stiger (kstiger)
*/
#include "globals.h"
#include "io.h"
#include "audio.h"
// The volume is controlled by 2 bytes - the MSB controls the left
// audio channel ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
/* edges */
int ab;
int ac;
int bd;
int cf;
int fg;
int de;
int df;
int ef;
int fEND;
int gEND;
static unsigned t1, t2, t3;
void func(int a1, int a2, int a3)
{
int i,j,k;
if(a1){
ab++;
i++;
bd++;
if(a2){
de++;
... |
C | /**
* A ideia desse código é
* definir qual número das entradas
* tem o menor valor
* Generated by:
* Joaquim Breno
*/
#include <stdio.h>
#include <locale.h>
int main(void)
{
float x1, x2;
setlocale(LC_ALL, "portuguese-brazilian");
printf("Olá, meu nome é Kodi o seu matemático digital! Siga meu... |
C | /* module title: revjul.c
* function name: char *revjul()
* main() for demo
*
* author: Kim J. Brand
*
* revision history:
* version/--date--/by reason--------------------------------------------
* 1.0 10/01/84 kb Common C Functions initial release
*
* compiled with: stdio.h
* compiled ... |
C | #include "CmacAesSubkeys.h"
#include <string.h>
#include "BitOperation.h"
// See RFC4493, Fig 2.2
static uint8_t const_Zero[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
// See RFC4493, Fig 2.2
#define CONST_RB 0x87
int CmacAesSubkeys_CalculateL... |
C | #include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
//Funcion con el modelo matematico donde estan las sumatorias
int maximizar(bool auxi, int ap[], int quantities[], char ingr[], int numOfDifferentIngredients, int pp[][numOfDifferentIngredients], FILE *fp3)
{
int suma = 0;
int... |
C | #include<stdio.h>
int main() {
extern int a = 100;
printf("THe value of a is %d\n", a);
return (0);
}
//
//7-18.c: In function ‘main’:
//7-18.c:5:13: error: ‘a’ has both ‘extern’ and initializer
//extern int a = 100;
//
|
C | #ifndef SHELL_COLORS_H
#define SHELL_COLORS_H
#include <allegro5/allegro.h>
/* This will store any color with two bytes for every part of the color.
* There is a function to convert that to an ALLEGRO_COLOR in utils.c */
typedef enum Color {
/*R G B A*/
RED = (int)0... |
C | #include<stdio.h>
int main()
{ int dog[100],a,i,d;
printf("type your quantity of your number: \n");
scanf("%d",&a);
for(int i=1; i<=a; i++) {
scanf("%d",&dog[i]);
}
i=1;
for( ; i<=a; i++) {
if(dog[i]==0) {
printf("yes zero is available\n");
d=0;
... |
C | /*
* =====================================================================================
*
* Filename: exploitable.c
*
* Version: 1.0
* Created: 09/27/2015 12:32:05 AM
* Revision: none
* Compiler: gcc
*
* Author: Taishi Nojima (tn246), taishi.nojima@yale.edu
*
... |
C |
#include <fcntl.h>
ssize_t read(int fd,void * ptr,size_t len) __smallc __naked
{
#asm
INCLUDE "fcntl.def"
ld hl,6
add hl,sp
ld a,ESPCMD_READ
call __esp_send_cmd
ld a,(hl) ;fd
call __esp_send_byte
dec hl ;sp+5
dec hl ;sp+4
de... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* push_swap.h :+: :+: :+: ... |
C | #include <stdio.h>
void main(int argc, char const *argv[])
{
/* code */
int ch;
FILE *fp;
if (argc!=2)
{
/* code */
printf("error format,uasge:display filename\n");
}
if ((fp=fopen(argv[1],"r"))==NULL)
{
/* code */
printf("the file <%s> can not be opened.\n",argv[1] );
return;
}
ch=fgetc(fp);
while... |
C | #include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <wiringPiSPI.h>
#define CHANNEL 0
uint8_t snow[] = {
0, //00000000
40, //00101000
146, //10010010
84, //01010100
40, //00101000
84, //01010100
146, //1001001... |
C | #include<math.h>
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
#define TOKENSIZE 100
#define HASHMAX 1000
#define MAXINPUT 5000
struct node{
long i; /* to store integer value t = 'i' */
char *s; /* to store symbol t = 's' */
double f; /* to store floating value t = 'f' ... |
C | #include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
void mycat(char* filename)
{
int file;
char c;
file = open(filename, O_RDONLY);
if(file == -1) {
printf("Error when open file.\n");
return ;
}
int flag = 0;
flag = read(file, &c, sizeof(char));
while(flag != -1 ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <mpi.h>
#define BLOCK_LOW(id,p,n) ((id)*(n)/(p))
#define BLOCK_HIGH(id,p,n) (BLOCK_LOW(((id)+1),p,n)-1)
#define BLOCK_SIZE(id,p,n) ((BLOCK_LOW(((id)+1),p,n))-(BLOCK_LOW(id,p,n)))
#define BLOCK_OWNER(index,p,n) (((p)*(index)+1)-1)/(n))
int main (... |
C | #include <stdio.h>
#include <stdlib.h>
double min(double a, double b);
int main(){
double a, b;
printf("give 2 number:\n");
//double 的转换说明符必须是%lf,
//%f, %l都无法正确读取数值保存到变量中
scanf("%lf %lf", &a, &b);
printf("the small one of %lf and %lf is %lf\n", a, b, min(a, b));
return 0;
}
double min(double a, double b)... |
C | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<malloc.h>
struct node
{
int data;
struct node *right;
struct node *left;
};
struct node *start=NULL;
struct node* count(struct node* start);
struct node* insertb();
struct node *create()
{
struct node *p,*ptr;
int num;
printf("ENTER -1 TO END LOOP\n... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <complex.h>
#define PI 3.141592654
typedef struct
{
int col_no;
int row_no;
double **data;
} Matrix;
Matrix *matrix_init(int row_no, int col_no)
{
Matrix *matrix = (Matrix *)malloc(sizeof(Matrix));
matrix->col_no = col_no;
matr... |
C | #include<stdio.h>
#include"common.h"
int stringLen(char *s){
int n;
for (n=0; *s++;n++)
;
return n;
}
char* strCopy(char *s,char *dist){
while((*dist++=*s++))
;
return dist;
}
int getLine(char *s,int max){
int c;
int i = 0;
while((c=getchar()) != '\n' && c != EOF){
... |
C | #define _GNU_SOURCE
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
// In dieser Funktion werden die Wertepaare abgezählt,
// indem die entsprechenden Zeilen gezählt werden.
//
// Die Ausgabe dieser Funktion ist gleich der Anzahl der Wertepaare.
int getNumberOfPoints(ch... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_ptr.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include "struct.h"
// LIST_PERSONPERSONlj
int add(LIST_PERSON** list, PERSON person)
{
// Kvȃm
LIST_PERSON* newlist = (LIST_PERSON*)malloc(sizeof(LIST_PERSON));
if (newlist == NULL)
{
// mێs
return -1;
}
// lݒ
newlist->person = person;... |
C | /*
Copyright 2015 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
C | /*
* Project: TJ Shell, a small Linux shell
* File: tj_shell.c
* Author: Tobias Johansson
* Version: 1.0, 18 May 2015
*
* Compilation: gcc -pedantic -ansi -Wall -Werror -O4 -D SIGDET=1 tj_shell.c
*/
#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#... |
C | #include "holberton.h"
#include <stdlib.h>
/**
* string_nconcat - concat 2 strings up to n characters of 2nd
* @s1: string 1
* @s2: string 2
* @n: number of characters of s2 to cat
* Return: concatenated string or null if malloc fails
*/
char *string_nconcat(char *s1, char *s2, unsigned int n)
{
char *s3;
int ... |
C | #include <stdio.h>
#include <stdlib.h>
#include "ensemble.h"
ensemble* creerEnsemble ( composante* c){
ensemble* e = (ensemble*)malloc(sizeof(ensemble));
e->tete = c;
e->queue = c;
c->ens = e;
return e;
}
composante* trouverEnsemble (composante* c){
return( c->ens->tete );
}
void Union(composante* c1,co... |
C | #include <stdio.h>
int main(void){
int A, B, C, D;
scanf("%d %d", &A, &B);
scanf("%d %d", &C, &D);
int DIFERENCA = A * B - C * D;
printf("DIFERENCA = %d\n",DIFERENCA);
return 0;
}
|
C | #include "common.h"
#include <avr/io.h>
#include <util/delay.h>
#include "leds.h"
#include "gpio.h"
#include "buttons.h"
/******************************************************************
TIMER FUNCTIONS
******************************************************************/
// Global variable for timer
volatile uin... |
C | /*
** EPITECH PROJECT, 2020
** MY GET NBR CHAR
** File description:
** NO DESCRIPTION FOUND
*/
int my_getnbrchar(char str)
{
if (str < '0' && str > '9' )
return (0);
else
return (str - 48);
}
|
C | #include <mysql.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char **argv)
{
MYSQL *conn;
int err;
MYSQL_RES *resultado;
MYSQL_ROW row;
conn = mysql_init(NULL);
if (conn==NULL) {
printf ("Error al crear la conexion: %u %s\n", mysql_errno(conn), mysql_error(conn));
exit (1);
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.