language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include "shell.h"
/**
* main - Imput function for the program
* @argc: ARGument Counter
* @argv: ARGument Vector
* @env: ENviroment Variables
* Return: Always 0 (success)
*/
int main(int argc, char *argv[], char *env[])
{
_getenv(env);
(void)argc;
prompt(argv);
return (0);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
// Декларация и инициализация разрешенных на вход флагов
const char * const allowedFlags[] = { "--size", "--sort", "--antg" };
const unsigned int const allowedFlagsLength = sizeof allowedFlags / sizeof allowedFlags[0];
void validateFlags(... |
C | #include <stdio.h>
#include <stdlib.h>
#include "head.h"
int compare(tree R,tree R2)
{
if((R==NULL)&&(R2==NULL)) return 1;
else if (R->val!=R2->val) return 0 ;
else
{
return compare(R->l,R2->l) && compare(R->r,R2->r);
}
}
tree add(tree R,int val)
{
struct node* neww;
... |
C | /**
* @file filters_test.c
* @brief Test of filters module.
* @author Henrick Deschamps
* @version 1.0.0
* @date 2016-06-10
*/
#include <rrosace_filters.h>
#include <stdio.h>
#include <stdlib.h>
#include "test_common.h"
#define MODULE "filters"
static int test_one_filter(rrosace_filter_type_t type,
... |
C | #include<sys/socket.h>
#include<netinet/in.h>
#include<netdb.h>
#include<unistd.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#define NUMSTR 3
char *reqlines[NUMSTR] = {
"GET /le2soft/ HTTP/1.1\r\n",
"Host: www.fos.kuis.kyoto-u.ac.jp\r\n",
"\r\n",
};
int main(int argc, char* argv... |
C | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void insertAtBeginning(int);
void insertAtEnd(int);
void insertBetween(int,int,int);
void display();
void removeBeginning();
void removeEnd();
void removeSpecific(int);
struct Node
{
int data;
struct Node *next;
}*head = NULL;
void main()
{
int n=0;
... |
C | #include "machine.h"
#include "WFF.h"
#include "WFFlist.h"
#include <time.h>
/* Global WFF structure */
extern struct WFFglobal_st WFFglobal;
long _WFFmain_print_listing (form, label1, label2, filename)
Form form;
int label1;
int label2;
char *filename;
{
long status;
int i, *col... |
C | #include<stdlib.h>
#include"extracted.h"
/* C <- A+B
* A et B sont à coeffs nuls en dehors des blocs de tailles
* mA*nA, mB*nB et on a ("left") mA>=mB, nA>=nB
* */
void _addl (int * A, int * B, int * C,
// Dim des sous-matrices
int mA, int nA, int mB, int nB,
// Nombre d... |
C | /*
* Exercise 3-5
*
* Write the function itob(n,s,b) that converts the integer n into a base b
* character representation in the string s. In particular, itob(n,s,16)
* formats n as a hexadecimal integer in s.
*
* Not sure what would be the best solution for negative values since different
* bases suggest a sig... |
C | #ifndef __FT_STRNCMP__
#define __FT_STRNCMP__
int ft_strncmp(char *s1, char *s2, unsigned int n)
{
int i;
i = 0;
while((s1[i] || s2[i]) && (i < n)){
if(s1[i] < s2[i]){
return (-1);
}
if(s1[i] > s2[i]){
return (1);
}
i++;
}
return (0);
}
#endif
|
C | #include <stdio.h>
#include <stdlib.h>
static unsigned int testvar = 0xdeadbeef;
void
print_test()
{
printf("Test var: 0x%x\n", testvar);
}
int
main (int argc, char** argv)
{
int i;
int* tmp = malloc(sizeof(int));
for (i = 0; i < 4; i++)
{
printf("Old %i: %x\n", i, tmp[i]);
tmp[... |
C | // compile with gcc -fopenmp parallel_calc_pi.c
# include <stdio.h>
# include <omp.h>
# include <math.h>
static long n_stp = (int) 1e10; // number of discretizations
double t0, dt, pi, dx = 0.0; // variables
int i;
int main()
{
dx = 1.0 / (double) n_stp; // the size of the step to take
t0 = ... |
C | #include <stdio.h>
int main(){
long long a, b; scanf("%lld %lld", &a, &b);
while(1){
int chk=0;
if ( !a || !b ) break;
if ( a>= 2*b ) a%=(2*b), chk=1;
if ( !chk && b>= 2*a ) b%= (2*a), chk=1;
if ( !chk) break;
}
printf("%lld %lld\n", a, b);
}
|
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_split.c :+: :+: :+: ... |
C | #include <stdio.h>
int main(void) {
unsigned short u = 0;
short s = 0;
int i = 0;
for (i=0; i<0xFFFF+2; i++) {
u = i;
s = i;
printf("%d %u %d\n", i, u, s);
}
return 0;
}
|
C | #include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
#include "manager.h"
#include "createWindow.h"
#include "createProject.h"
#include "fileIO.h"
#include "chooseFolder.h"
// GUI information
#define FILENAME "createProject"
#define STRUCT_SIZE 7
static const char *WidgetNames[STRUCT_SIZE] = {
FILEN... |
C | //ftp-manager.h
#ifndef _FTP_MANAGER_H_
#define _FTP_MANAGER_H_
/*FTP OPERATION CODE*/
typedef enum FTP_STATE
{
FTP_UPLOAD_SUCCESS,
FTP_UPLOAD_FAILED,
FTP_DOWNLOAD_SUCCESS,
FTP_DOWNLOAD_FAILED
}FTP_STATE;
/*FTP OPERATIONS OPTIONS*/
typedef struct FTP_OPT
{
char *url; /*url of ftp*/
c... |
C | /**
* History:
* ================================================================
* 2017-05-28 qing.zou created
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <time.h>
#include <sys/time.h>
#include "vpk.h"
#if defined(_X86_)
#else
#endif
#include <errno.h>
static... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <pthread.h>
#include <stdint.h>
#define POS_X 0
#define POS_Y 1
#define MASS 2
const double epsilon_0 = 0.001;
//declare node structure (X)
//maybe good idea is to compact it! (ie no padding)
typedef struct tree_... |
C | /*
------------------------------------------------------------------------------
Licensing information can be found at the end of the file.
------------------------------------------------------------------------------
cute_math2d.h - v1.00
SUMMARY:
2d vector algebra implementation in C++. Makes use of operat... |
C | /*
smartmed.c: SmartMedia Flash ROM emulation
The SmartMedia is a Flash ROM in a fancy card. It is used in a variety of
digital devices (still cameras...) and can be interfaced with a computer.
References:
Datasheets for various SmartMedia chips were found on Samsung and Toshiba's
sit... |
C | #include "stdio.h"
#define ListSize 100
typedef int DataType;
typedef struct {
DataType data[ListSize];
int length;
} SeqList;
typedef struct node {
DataType data;
struct node *next;
} ListNode;
typedef ListNode *LinkList;
LinkList CreateListF() {
LinkList head;
ListNode *p;
char ch;
... |
C | #include "../../lv_examples.h"
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
/**
* Create a drop down, up, left and right menus
*/
void lv_example_dropdown_2(void)
{
static const char * opts = "Apple\n"
"Banana\n"
"Orange\n"
... |
C | #include <sys/socket.h>
#include <unistd.h>
#include <linux/in.h>
#include <signal.h>
#include <string.h>
#include <stdio.h>
char buf[10000];
int main(){
int connfd,sock_fd;
struct sockaddr_in client,info;
socklen_t len;
sock_fd=socket(AF_INET,SOCK_STREAM,0);
bzero(&client,sizeof(client));
client.sin_family=AF_IN... |
C | //bibliotecas
#include<stdio.h>
#include<stdlib.h>
//declaração de variaveis globais para utilizar na pilha e no programa
int tam = 8, topo = -1, valor;
int pilha[8];
//empilha
void empilha()
{
if(topo == tam - 1)
{
printf("\n **Pilha cheia**\n");
}
else
{
topo++;
pilha[topo] = valor;
}
}
//desempilha
v... |
C | //
// cdata.h
// cthread
//
// Created by Henrique Valcanaia on 15/09/16.
// Copyright © 2016 Henrique Valcanaia. All rights reserved.
//
#ifndef cdata_h
#define cdata_h
#include "support.h"
enum THREAD_STATE {
CREATION = 0,
READY = 1,
EXEC = 2,
BLOCKED = 3,
FINISH = 4
};
/*!
@struct s_TCB
... |
C | #define F_CPU 16000000UL
#include <avr/io.h>
#include <stdlib.h>
#include "LCD4bits.h"
//#define data_direction DDRD
//#define data_ports PORTD
//#define RS PD2
//#define EN_pin PD3
int main(void)
{
LCD_Initialization();
//LCD_dataCharacter('t');
LCD_dataString("All work well");
int increment... |
C | #include "holberton.h"
/**
* reset_to_98 - this function reset the valuo to 98
* @n: input pointer variable.
*
*/
void reset_to_98(int *n)
{
*n = 98;
}
|
C | #include <curl/curl.h>
#include "js.h"
typedef struct {
char* ptr;
size_t len;
} string;
typedef struct {
char* url;
napi_ref cb;
napi_async_work work;
string body;
} req_t;
static void init_string(string* s) {
s->len = 0;
// FIXME: replace with js_malloc
s->ptr = malloc(s->len + 1);
if (s->ptr =... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
void get_memory(char** p){
*p = (char*) malloc(10);
}
char* get_value(){
char *p = (char*)malloc(10);
strcpy(p,"haha");
return p;
}
int main(){
char* p = NULL;
get_memory(&p);
strcpy(p,"hello world");
printf("%s\n",p);
free(p);
p = NULL;
... |
C | #ifndef _XN_SPRITE_3D_H_
#define _XN_SPRITE_3D_H_
#include <windows.h>
#include "xnList.h"
#pragma pack (push)
#pragma pack (16)
struct Vertex {
float x, y, z, w;
WORD fu, fv;
};
#pragma pack (pop)
struct UVPoint {
float u, v;
};
struct Triangle {
DWORD a, b, c;
};
struct xnUV_List {
UVPoint * pUV_PointBuff... |
C | #include <stdio.h>
int main()
{
int score[5];
int i, max =0;
for(i = 0; i<5; i++)
{
printf("%d л α Էϼ. : ", i+1);
scanf("%d", &score[i]);
}
for(i = 0; i<5; i++)
if(max < score[i])
max = score[i];
printf("ְ : %d", max);
}
|
C | #include <stdio.h>
int main()
{
int x[15], cont = 0;
for(int i = 0; i < 15; i++)
{
printf("Insira o termo %d do vetor X\n", i+1);
scanf("%d", &x[i]);
}
for(int i = 0; i < 15; i++)
{
if(x[i] % 2 == 0)
{
cont++;
}
}
printf("O numero de termos pares e: %d\n", con... |
C | #pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int get_number_of_elements();
int *get_array_elements(int n);
int merge_sort(int *n, int min, int max);
void merge(int *n, int min, int middle, int middle2, int max);
void print_elemts(int*n, int size, int *n2);... |
C | #pragma once
struct Point
{
Point() = delete;
explicit Point(double x_, double y_):x(x_), y(y_){};
double x, y;
};
|
C | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <malloc.h>
/* Data Type Define */
#define OK 1
#define ERROR 0
#define UNSIGN -1
#define MAXNUM 230000
//MAX_NUMָӾ伯Ӿ
#define PL 11
//PLָĿٵά
#define SET_TIME 5
//SET_TIMEǹ涨ʱ
typedef int Status;
... |
C | #include <stdio.h>
//Temperature Conversion execise
main(){
int f, c;
int start, limit, incr;
start=0;
limit=300;
incr=20;
while(f<=limit){
c = 5*(f-32)/9;
printf("%d\t %d\n", c, f);
f=f+20;
}
}
// This changing int to float did not work, so two ways to fix this,... |
C | //
// main.c
// 单项链表
//
// Created by 张耘博 on 2018/10/16.
// Copyright © 2018 张耘博. All rights reserved.
//
#include <stdio.h>
#include "LinkList.h" //用尖括号报错:'LinkList.h' file not found with <angled> include; use "quotes" instead提示引号代替:原因:这个头问价为用户自己定义的
typedef struct PERSON{
char name[64];
int age ;
int ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* event.c :+: :+: :+: ... |
C | #include "List.h"
#include <stddef.h>
/**
* Compares the one specified list with another for equality.
*
* @param ptr The one list to be compared for equality
* @param sizePtr The list size function
* @param getPtr The list get function
* @param o The other list to be compared for equality
* @param sizeO The o... |
C | #include <stdio.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <string.h>
#define SOCK_NAME "mysocket"
int main (int argc, char ** argv)
{
int sock;
struct sockaddr_un addr;
if (argc < 2) {
fprintf (stderr, "Too few arguments\n");
return 1;
}
sock = socke... |
C | #include <stdio.h>
#include <stdlib.h>
void merge(int a[], int l, int m, int u) { //merges arrays in sorted order
int i, j, k;
int n1, n2; //number of elements in each temp array
n1 = m - l + 1;
n2 = u - m;
int b[n1];
... |
C | /*
可变参数
*/
#include <stdio.h>
#include <stdarg.h>
double average(int num, ...)
{
va_list valist;
double sum = 0.0;
int i;
// 为 num 个参数初始化 valist
va_start(valist, num);
int tmp = 0;
// 访问所有赋给valist 的参数
for (i = 0; i < num; i++)
{
tmp = va_arg(valist, ... |
C | /* Write a program to display a right angle triangle with N number of rows, like below.
Input:
5
Output:
1
12
123
1234
12345 */
#include <stdio.h>
int main()
{
int number, i, j;
scanf("%d", &number);
for(i = 1; i <= number; i++){
for(j = 1; j <= i; j++){
printf("%d", j);
}
printf("\n... |
C | /*
* gpio.h
*
* Created on: 13 Jun 2015
* Author: am5514
*/
#ifndef GPIO_H_
#define GPIO_H_
/* Physical addresses of the pin accesses in memory */
#define GPIO_PINS_20_29 0x20200008
#define GPIO_PINS_10_19 0x20200004
#define GPIO_PINS_0_9 0x20200000
/* Addreses of the control and setting pins */
#define ... |
C | #include "string.h"
char * strcpy(char * destination, const char * source) {
char * result = destination;
while (*(destination++) = *(source++));
return result;
}
size_t strlen(const char * string) {
size_t result = 0;
while (string[result])
result++;
return result;
}
|
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* move_3.c :+: :+: :+: ... |
C | /*
============================================================================
Name : testC.c
Author : Tomasz Strzałka
Version :
Copyright : Your copyright notice
Description : Hello World in C, Ansi-style
============================================================================
*/
#inclu... |
C | #include <stdio.h>
int main(int argc, char const *argv[]) {
char buf[1000];
scanf("%s", buf);
if (buf[0] >= 97 && buf[0] <= 122) {
buf[0] -= 32;
}
printf("%s\n", buf);
return 0;
}
|
C | #ifndef SD_ICONV_H_20081229
#define SD_ICONV_H_20081229
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef _int32
#define _int32 int
#endif
#ifndef _u32
#define _u32 unsigned int
#endif
#ifndef _u8
#define _u8 unsigned char
#endif
#ifndef _u16
#define _u16 unsigned short
#endif
... |
C | #include "Hostel.h"
int checkIfRoomExists(Hostel* ht, int roomNumber);
// Name: Almog Afuta
// Id:319114245
// Name: Gil Didi
// Id:318353422
/******************************************************************************
Name: Hostle AddRoom
Inputs: ht(HOstle*), room(Room*)
Output: Hostle*
Descriptio... |
C | /*
** game.c for in /home/thomas/Documents/epitech/CPE_2015_Allum1
**
** Made by Thomas HENON
** Login <thomas.henon@epitech.net>
**
** Started on Mon Feb 15 16:12:37 2016 Thomas HENON
** Last update Sun Feb 21 12:08:18 2016 thomas
*/
#include "allum.h"
char win(int nbr_lines, int *allums)
{
int i;
i = 0;
... |
C | // C Program to check whether a number is Armstrong or not
#include<stdio.h>
#include<math.h>
void ArmstrongNumber(int n){
int num=n, rem, sum=0;
// Counting number of digits
int digits = (int) log10(num) + 1;
while(num > 0)
{
rem = num % 10;
sum = sum + pow(rem,digits)... |
C |
#include<sys/epoll.h>
#include <errno.h>
#include "../include/epollmp.h"
#include "../include/iomp.h"
#include "../include/zmemory.h"
#define mpSetError setError
typedef struct mpState
{
int epfd;
struct epoll_event* events;
fireEvent* fevents;
int maxEv;
} mpState;
static mpState* state = 0;
int mpCreate(... |
C | #ifndef _CYCLELKLIST_H_
#define _CYCLELKLIST_H_
#include "type.h"
#include "common.h"
/**
* ѭ
* *headָͷָ
* *currentָǰָ
* lengthΪij
*/
typedef struct CycleLkList
{
LkNode *head;//ָѭͷ
LkNode *current;//ָǰ
LkNode *trail;//ָѭβ
int length;//ij
}CycleLkList;
//ѭʼ
WORD cycleLkListInit(CycleLkList**);
//ѭ
WORD cycleLkList... |
C | #include <stdio.h>
#pragma warning( disable : 6031)
int main(void)
{
printf("Enter x: ");
double x = 0.0;
scanf("%lf", &x);
double res = 0.0;
if (x <= 0)
res = -x;
if (x > 0 && x < 2)
res = x * x;
if (x >= 2)
res = 4;
printf("f = %lf", res);
} |
C | #include "snake.h"
//ýṹָʼϢ
void initSnake(Snake *s){
s->x = 1;
s->y = 1;
s->pre = NULL;
s->next = NULL;
}
//жϷͷϷ
int isSnakeEatItself(Snake *head){
int gameOver = 0;
Snake *pt = head->next;
while (pt){
if (head->x == pt->x && head->y == pt->y){
gameOver = 1;
break;
}
pt = pt->next;
}
return gameO... |
C | #include<stdio.h>
#include<string.h>
int Cmp(char *A, char *B);
void Reverse(char *str, int len);
void Add(char *A, char *B, char *Result);
void Sub(char *A, char *B, char *Result);
void Mul(char *A, char *B, char *Result);
void Mul_(char *A, char *B, char *Result);
int main()
{
char A[65] = {0};
char B[65] = {0};... |
C | /*By:Yash Mudgal
Date:12/09/2019*/
#include<stdio.h>
void main()
{
int i=0;
for(;i<100;i++)
if((i/10)%2==1)
printf("%d ",i);
}
|
C | #include<stdio.h>
#include<math.h>
#include < string.h >
int strle(const char *str)
{
return(strlen(*str));
}
char *find(const char *str, const char *substr)
{
char *p;
p = strchr(str, substr);
char o = (p - str + 1);
return(&o);
}
void delete(char *str, const char *substr)
{
printf("pos: %d\n", strstr(str, ... |
C | #include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
int ft_iterative_factorial(int nb)
{
int ftl;
ftl = 1;
if (nb < 0)
ftl = 0;
while (nb != 0 && nb > 0)
{
ftl = ftl * nb;
nb--;
}
return(ftl);
}
int main()
{
printf("%d\n", f... |
C | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int isPrime(long int);
int main(){
long int t, count,i;
scanf("%ld", &t);
long int num,max;
while(t--){
max = 0;
count = 0;
num = 0;
char *str = (char*)malloc(100000*sizeof(char));
scanf("%s", str);
for(i=0; i<strlen(str)+... |
C | #include <stdio.h>
struct node{
int data;
struct node* link;
};
void main(void){
struct node n1, n2, n3;
n1.data = 10;
n1.link = &n2;
n2.data = 20;
n2.link = &n1;
n3.data = 30;
n3.link = &n3;
printf("%d %d %d \n", n1.data, n2.data, n3.data); // 10 20 30
printf("%d %d %d \n", n2.link -> data, n1.link -> ... |
C | #include "variadic_functions.h"
/**
* print_all - function that prints anything.
* @format: const char pointer
* Return: void
**/
void print_all(const char * const format, ...)
{
va_list list;
char *s;
int j = 0, k = 1;
va_start(list, format);
while (format && format[j])
{
switch (format[j])
{
case 'c... |
C | #include <stdio.h>
#include <math.h>
void app35(int a,int b,int c,int d)
{
if (a == b + c + d || b == a + c + d || c == a + b + d || d == a + b + c) {
printf("true\n");
}else{
printf("false\n");
}
}
void main()
{
int a,b,c,d;
printf("a:");
scanf("%d",&a);
printf("\n");
p... |
C | /*
* This work is part of the White Rabbit project
*
* Copyright (C) 2011 CERN (www.cern.ch)
* Author: Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc < 3)
... |
C | #include <stdio.h>
#include <stdlib.h>
void triplePointeur(int *pointeurSurNombre);
int main()
{
int nombre = 5;
int *pointeur = &nombre; //pointeur prend l'adresse de nombre.
triplePointeur(pointeur); //on envoie pointeur (l'adresse de nombre) à la fonction.
printf("%d\n", *pointeur); //on affiche ... |
C | #include<stdio.h>
main()
{
int x,n,s=1,i;
printf("Enter the value of base,x: ");
scanf("%d",&x);
printf("Enter the value of power,n: ");
scanf("%d",&n);
if (n>=0)
{
for(i=0;i<n;i++)
s=s*x;
printf("\nValue of %d to the power %d is: %d\n",x,n,s);
}
else
... |
C | #include "stdio.h"
int main()
{
int n,c,m,i,max,num,tmp=0;
scanf("%d %d %d",&n,&c,&m);
max=c*m;
for(i=0;i<n;i++)
{
scanf("%d",&num);
if(num>max)
tmp=1;
}
if(tmp)
printf("No\n");
else
printf("Yes\n");
return 0;
}
/*
Alice owns a company that tr... |
C | #include "minishell.h"
void free_tab(char **str)
{
int i;
int len;
i = 0;
len = 0;
while (str[len])
len++;
while (i < len)
{
free(str[i]);
i++;
}
}
|
C | #include <stdio.h>
//float subset_methx(FILE *, const int includes, const int excludes, const int n_samples) {
//
// const int INIT_SIZE = 10000;
// float data[INIT_SIZE][n_samples];
// return data;
//}
int main(){
FILE *ifile;
const int includes = 5, excludes = 32, n_samples = 16;
//float data... |
C | #include <stdio.h>
#include <string.h>
char *mx_strchr(const char *s ,int c);
int mx_strlen(const char *s);
int mx_strncmp(const char *s1, const char *s2, int n );
char *mx_strstr(const char *s1, const char *s2) {
int len1 = mx_strlen(s1);
//int len2 = mx_strlen(s2);
// int c = 0;
// mx_strncmp(s1,s2,len... |
C | #include <stdio.h>
#include <stdint.h>
float absoluteValue (float x){
if ( x < 0 )
x = -x;
return (x);
}
// Function to compute the square root of a number
float squareRoot (float x, float epsilon){
//const float epsilon = .00001;
float guess = 1.0;
while ( absoluteValue (guess * guess - x) >= epsilon )
guess = ( ... |
C | #include<errno.h>
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<string.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<sys/prctl.h>
#include<sys/mman.h>
typedef struct map {
long long int addr;
long long int length;
char* path;
} map;
int set_exe_file... |
C | /*
** main.c for in /home/nicolas/horbac_n/my_sort_int_tab
**
** Made by HORBACZ Nicolas
** Login <horbac_n@etna-alternance.net>
**
** Started on Thu Mar 23 10:10:40 2017 HORBACZ Nicolas
** Last update Thu Mar 23 17:45:25 2017 HORBACZ Nicolas
*/
#include <stdio.h>
void my_sort_int_tab(int *tab, int size);
int ... |
C | /*************************************************************************
> File Name: sequence_reverse.c
> Author: zhuxinquan
> Mail: zhuxinquan61@gmail.com
> Created Time: 2015年09月20日 星期日 17时42分27秒
************************************************************************/
#include<stdio.h>
#include<stdlib.h>
#... |
C | /*
* Delta programming language
*/
#include "delta/delta.h"
#include <string.h>
#include <ctype.h>
/**
* @category modules/core/string
*
* @brief Trim right side of a string of whitespace.
*/
DELTA_FUNCTION(rtrim)
{
// prepare incoming arguments
int size, i;
char *arg0 = delta_cast_new_string(DELTA_ARG0, ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* keyhandle.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include "matrix.h"
// cria uma matriz de zeros com dimensão especificada
matrix *create_matrix(unsigned long n_lin, unsigned long n_col) {
unsigned long i;
matrix *m = malloc(sizeof(matrix));
m->lin = n_lin;
m->col = n_col;
m->val = (doub... |
C | /*
* Application.c
*
* Created on: Jul 1, 2013
* Author: Erich Styger
*/
#include "Application.h"
#include "SW1.h"
#include "LEDR.h"
#include "LEDG.h"
#include "LEDB.h"
#include "WAIT1.h"
#include "HIDJ1.h"
#include "AD1.h"
#include "SW1.h"
#include "SW2.h"
#include "SW3.h"
#include "SW4.h"
#include "SW5.h"... |
C | #include "rAlgo.h"
#define DET_NUM 200
char **selfSet;
int **matrix, ma;
void initMat()
{
int i, j;
matrix=(int **)malloc(sizeof(int *)*ma);
for(i=0; i<ma; i++)
matrix[i]=(int *)malloc(sizeof(int)*ma);
for(i=0; i<ma; i++)
for(j=0; j<ma; j++)
matrix[i][j]=0;
}
int getDetector(int r1, i... |
C | #include <stdio.h>
#include <stdint.h>
int main(int argc, char* argv[])
{
// Ensure proper usage
if (argc != 2)
{
fprintf (stderr,"Error! Usage: ./recover forensic image\n");
return 1;
}
// Opening the card file in read mode
FILE *fptr = fopen(argv[1],"r");
if (fptr ==... |
C | /* ************************************************************************** */
/* */
/* :::::::: */
/* ft_realloc.c :+: :+: ... |
C | #include "LCD.h"
#include <stdint.h>
#include "ST7735.h"
#include "LineDrawer.h"
extern const unsigned short ClockFace_24bit[];
uint32_t TimeX = 0;
uint32_t TimeY = 1;
uint32_t AlarmX = 2;
uint32_t AlarmY = 3;
uint32_t StatusX_ON = 4;
uint32_t StatusY_ON = 5;
uint32_t StatusX_OFF ... |
C | /*
*
* pre_execute
* En base a sus parametros, devuelve una estructura
* sencilla con los datos necesarios para operar el
* proceso. Entre ellos, se encuentra el grafo del programa.
*
* */
process_params_t pre_execute(status_t program, graph_t mem);
/*
*
* true_step
* setea el nodo curren... |
C | #include<stdio.h>
#define AREA (2*10);
int main()
{
int AREA=2;
printf("%d",AREA);
return 0;
}
|
C | // Ordering three integers
// 12/03/2017
// By Anthony Xu - z561674@unsw.edu.au
#include <stdio.h>
int main(void) {
int a, b, c;
printf("Enter integer: ");
scanf("%d", &a);
printf("Enter integer: ");
scanf("%d", &b);
printf("Enter integer: ");
scanf("%d", &c);
printf("The integers in ... |
C | /*
** EPITECH PROJECT, 2017
** my_strncmp.c
** File description:
** compare to string up to n size
*/
#include "my.h"
int my_strncmp(char const *s1, char const *s2, int n)
{
int i = 0;
while (*s1 == *s2 && i <= n) {
++s1;
++s2;
++i;
}
return (*s1 - *s2);
}
|
C | #include <stdio.h>
void main()
{
int i, fact = 1, no;
printf("Enter the n0:\n");
scanf("%d", &no);
if (no<= 0)
fact = 1;
else
{
for (i = 1; i <= no; i++)
{
fact = fact * i;
}
}
printf("Factorial of %d = %5d\n", num, fact)
}
|
C | /*
** EPITECH PROJECT, 2020
** NWP_myteams_2019
** File description:
** client_execute_cmd.c
*/
#include <string.h>
#include "client.h"
#include "utils.h"
static void execute(client_t *client, char **tab)
{
char **tmp_tab = tab;
if (tmp_tab == NULL || tmp_tab[0] == NULL)
return;
for (int i = 0; ... |
C | #include "sys.h"
#include "delay.h"
#include "led.h"
#include "usart.h"
#include "mpu.h"
#include "lcd.h"
#include "sdram.h"
#include "usmart.h"
#include "key.h"
#include "stmflash.h"
//ALIENTEK STM32H7 ʵ37
//FLASHģEEPROM ʵ
//֧֣www.openedv.com
//ӿƼ˾
//Ҫд뵽STM32 FLASHַ
const u8 TEXT_Buffer[]={"STM32 FLAS... |
C | #include <stdio.h>
int count(int from, int to, void (*myOut)(int i))
{
int j = 0,
rv = 0;
if (from >= to) {
rv = -1;
} else {
for(j = 0; j < to - from; j++) {
rv += from + j;
}
}
(*myOut)(rv);
return 0;
}
void displayU(int i)
{
/* display the result in uppe... |
C | #include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#define BSIZE 1024 // buffer size
#define FPERM 0644 // file permission
int main(int argc, char *argv[]){
int fd1, fd2, n;
char buf[BSIZE];
if(argc < 3){
fprintf(stderr, "Usage: %s src dest\n", argv[0]);
exit(... |
C | #include <stdio.h>
#include <stdlib.h>
#define tam 5
main(){
int m,m2,n, a[tam],i,b, suma,me,c[tam],e[tam];
do{
system("cls");
printf("1 Capturar\n");
printf("2 Mostrar\n");
printf("3 Buscar\n");
printf("4 Promedio\n");
printf("5 Minimo\n");
printf("6 Inv... |
C | /*
Bryan Wood
lib.h
input, output, word, x, wordlength, linelength
*/
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
/*-------------------------------------------------------
opens files to be used as input and output
Receives: input, output... |
C | #include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Get input as string to prevent overstep the boundary */
int GetInputAsString(char *lpszInput, unsigned int uSize) {
int iResult;
char szFormat[5] = "%";
char szSize[3];
itoa(uSize - 1, szSize, 10);
strcat(szForma... |
C | //Allen Zou 9/18/2020
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "driver/uart.h"
#include "esp_vfs_dev.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#define BLINK_GPIO CONFIG_BLINK_GPIO
/* Can use project confi... |
C | /*
* Vorlesung "Rechnerstrukturen", Blatt 4, Aufgabe 14.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "boolean.h"
#include "stdint.h"
#include "colored_output.h"
#include "ipaddress.h"
/**
* Wandle eine IPv4 Addresse in eine ganzzahlige usigned 32-bit... |
C | #include<stdio.h>
void sortPancakes(int [], int);
void listReverse(int [], int, int);
int main(){
int a[10], i, k, n;
printf("How many Pancakes: ");
scanf("%d",&n);
printf("Enter the size of the Pancakes: ");
for(i = 0; i < n; i++){
scanf("%d",&a[i]);
}
sortPancakes(a, n);
printf("After sorting the Pancakes:... |
C | #include "headers.h"
long long get_time(void)
{
struct timeval now_time;
long long milisec;
gettimeofday(&now_time, NULL);
milisec = (now_time.tv_sec * 1000) + (now_time.tv_usec / 1000);
return (milisec);
}
int ft_strcmp(char *s1, char *s2)
{
int i;
i = 0;
while (s1[i] == s2[i] && s1[i] != 0 && s2[i] != 0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.