language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | // EE.c //
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h> // for LSEEK, OPEN, CREAT
#include <unistd.h> // for READ, WRITE, UNLINK, LSEEK, CLOSE
#include <sys/stat.h> // for OPEN, CREAT
#include <fcntl.h> // for OPEN, CREAT
#include <sys/wait.h> // for WAIT
#include ... |
C | #include "all.h"
int numVerAdj(Arestas * aresta, int vertice)
{
int adjacente;
if (aresta->rua->limite1 == vertice)
{
adjacente = aresta->rua->limite2;
}
else
{
adjacente = aresta->rua->limite1;
}
return adjacente;
}
int darVertice (Arestas * aresta, Grafo * g)
{
... |
C | #include <stddef.h>
extern void terminal_putchar(char c);
int putchar(char c)
{
terminal_putchar(c);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#define MAX_EDGES 100
#define MAXN 100
#define INFINITY 9999999
typedef struct
{
int x, y;
int w;
} Edge;
typedef struct
{
int n, m;
Edge edges[MAX_EDGES];
} Graph;
void init_graph(Graph *G, int n)
{
G->n = n;
G->m = 0;
}
void add_edge(Graph *G, int x, i... |
C | #include <stdio.h>
#include <stdlib.h>
#define TRUE 1
#define FALSE 0
int main(int argc, char*argv[]) {
return EXIT_SUCCESS;
}
int isSorted(int *a, int n) {
int i = 0;
int isSorted = TRUE;
while (i < n-2) {
if (a[i] > a[i+1]) {
isSorted = FALSE;
}
i++;
}
return isSorted;
}
int isSortedFor(int *a, ... |
C | #ifndef CAMERADEF_GUARD_H
#include "cameradef.h"
#endif
/**
* Move a câmera de acordo com o botão pressionado
* @param button Botão pressionado.
* @see #CAMERA_SLOW_MOVE_FOWARD
* @see #CAMERA_SLOW_MOVE_BACKWARD
* @see #CAMERA_SLOW_MOVE_LEFT
* @see #CAMERA_SLOW_MOVE_RIGHT
* @see #CAMERA_SLOW_MOVE_UP
* @see ... |
C | #include<stdio.h>
int main()
{
int v[3], i;
printf("Ingrese los valores en el vector\n");
for(i=0; i<3; i++)
{
printf("Posicion %d: \n", i+1);
scanf("%d", &v[i]);
}
if(v[0] > v[1] && v[0] > v[2])
printf("El valor mayor es: %d\n", v[0]);
if(v[1] > v[0] && v[1] > v[2])
printf("El valor mayor es: %d\n", ... |
C | #include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include "ext2.h"
#include <string.h>
#include <strings.h>
unsigned char *disk;
void aaaa(int *a) {
*a += 1;
}
int main(int argc, char **argv) {
... |
C | /*
** EPITECH PROJECT, 2020
** stumper
** File description:
** 24/03/2021
*/
#ifndef STUMPER_H
#define STUMPER_H
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char p1;
char p2;
int size;
char **board;
} game_t;
void print_map(game_t *game);
void get_input(game_t *game,... |
C | /*
* Library for movement that is shared by Lego and Create robots.
*
* Functions:
* int direction_multiplier(Direction direction)
* Prerequisite: the user must have set the robot
all these functions work for both
*
* Global variables:
* Robot _ROBOT;
* RunMode _MODE;
*
* Enumerations:
* Boo... |
C |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<netdb.h>
#include<sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#define MAX 200
#define PORT 8080
#define SA struct sockaddr
void func(int sockfd)
{
char buff[MAX], str[MAX];
i... |
C |
/*
this source code is for dividing a string to
*/
#include <stdio.h>
#include <stdlib.h>
char *divstring(char *s)
{
char *s2 = malloc(sizeof(s));
char *p = s, *p2 = s2;
int del_num = 0;
while(*p != '\0'){
if(*p >= 'a' && *p <= 'z'){
*p2 = *p; ++ p2;
++ del_num;
... |
C | /*
** EPITECH PROJECT, 2021
** mylist
** File description:
** string_list_dup
*/
#include "string_list_intern.h"
string_list_t *intern_string_list_duplicate(const string_list_t *this)
{
string_list_t *dest = string_list_create();
if (!dest)
return NULL;
list_foreach(node, this) {
if (dest... |
C | // map and constrain
long mapC(long n, long domainLow, long domainHigh, long rangeLow, long rangeHigh, bool clamp=true) {
long val = map(n, domainLow, domainHigh, rangeLow, rangeHigh);
if (clamp) {
if (rangeLow > rangeHigh) {
long swapTmp = rangeLow;
rangeLow = rangeHigh;
... |
C | /***************************************************
* 版权声明
*
* 本操作系统名为:MINE
* 该操作系统未经授权不得以盈利或非盈利为目的进行开发,
* 只允许个人学习以及公开交流使用
*
* 代码最终所有权及解释权归田宇所有;
*
* 本模块作者: 田宇
* EMail: 345538255@qq.com
*
*
***************************************************/
#include "memory.h"
#include "lib.h"
unsigned long... |
C | #include<stdio.h>
int main()
{
int matrix[3][3] = {{1,2,3},{4,5,6},{7,8,9}};
int i,j,sum=0,row=3,col=3;
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
if(i==j)
sum += matrix[i][j];
}
}
printf("%d ", sum);
}
|
C | #include "stack.h"
Stack*
stack_create (void) {
Stack* s = (Stack*)malloc(sizeof(Stack));
s -> prim = NULL;
return s;
}
void
stack_push (Stack *p, symbol_table *t) {
Node* n = (Node*)malloc(sizeof(Node));
n -> info = t;
n -> prox = p -> prim;
p -> prim = n;
}
symbol_table*
stack_pop (Stack *p) {
... |
C | #include<stdio.h>
#include<stdlib.h>
#include "descriptor.h"
int descriptorComparison(void* f1, void *f2){
MyDescriptor a = *(MyDescriptor*) f1;
MyDescriptor b = *(MyDescriptor*) f2;
return (a.cfd == b.cfd); //paragone solo su cfd
}
void descriptorPrint(void* c){
MyDescriptor d = *(MyDescriptor*)c;
printf("%d ... |
C | #pragma once
typedef struct node {
//Ա
int data;
struct node *next;
} NODE,*PNODE;
typedef struct stack
{
struct node * top;
}STACK,*PSTACK;
void init(PSTACK stack);
int isEmpty(PSTACK stack);
int push(PSTACK stack,int data);
int pop(PSTACK stack);
PSTACK createStack();
int getStack(PSTACK p); |
C | /*
** EPITECH PROJECT, 2021
** anim mob
** File description:
** file 1
*/
#include "my_defender.h"
void game_mob_anim(my_struct_t *store)
{
game_mob_link_t *tmp = store->game->first_mob;
for (int nb = 0; nb < store->game->nb_mob; nb += 1) {
tmp->rec.left += 32;
if (tmp->rec.left > 64)
... |
C | #include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#ifndef C_BIBLIO_H
#define C_BIBLIO_H
typedef enum Genre{BD, PO, TH, RO, RH, LF, LE, SC, IN, SF, SA, HI}Genre;
typedef struct Livre{
char titre[128];
char auteur[80];
long isbn;
char editeur[50];
int annee_edition;
... |
C | /*
* Auxiliary functions for directory table
*/
#ifndef __DIR_H
#define __DIR_H
#include <stdint.h>
#include "myfs.h"
#define BLOCKTYPE uint16_t
struct dir {
struct dir_entry {
char filename[MAXFILENAMESIZE];
int inum; // index of fcb in table
} entries[MAXFILECOUNT];
struct fcb_entry {
uint8_t valid;
... |
C | #include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
int myid, numprocs;
int count, source, i, j, tag;
int *buffer, *temp;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &myid);
count = 2000;
source = 0;
tag = 1234;
if (m... |
C | /*
* Functions related to the structs used to represent JSON values
*/
#include <stdlib.h>
#include <string.h>
#include "jzen.h"
#define STD_CREATE(NAME) jzen ## NAME *jzen ## NAME ## _create() \
{ \
jzen ## NAME *item = (jzen ## NAME *)malloc(sizeof(jzen ## NAME )); \
if (item) bzero(item... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_cut.c :+: :+: :+: ... |
C | #include <stdio.h>
void countingSort(int arr[], int n, int exp) {
int i, count[10] = {0};
int sorted[n];
for(i = 0; i < 10; ++i)
++count[(arr[i]/exp) % 10];
for(i = 1; i < 10; ++i)
count[i] += count[i-1];
for(i = n-1; i >= 0; --i) {
sorted[count[(arr[i]/exp) % 10] - 1] = arr... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <gtk/gtk.h>
#define BOMB 9
//gcc `pkg-config --cflags gtk+-3.0` -o game game.c `pkg-config --libs gtk+-3.0`
//GDK_SCALE=2 ./game
typedef struct bncos
{
int n;
int click;
GtkWidget *timer;
GtkWidget *button;
} bn;
v... |
C | #ifndef COM_NGOS_SHARED_COMMON_NGOS_STATUS_H
#define COM_NGOS_SHARED_COMMON_NGOS_STATUS_H
#include <com/ngos/shared/common/ngos/types.h>
#include <com/ngos/shared/common/printf/printf.h>
enum class NgosStatus: u64
{
OK = 0,
FAILED = 0x8000000000000001,
NO_EFFECT ... |
C | /*
* @lc app=leetcode.cn id=922 lang=c
*
* [922] 按奇偶排序数组 II
*/
// @lc code=start
#include <stdlib.h>
/**
* Note: The returned array must be malloced, assume caller calls free().
*/
int* sortArrayByParityII(int* A, int ASize, int* returnSize){
int i = 0, j = 0;
int* arr = calloc(ASize, sizeof(int));
*retur... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int i, j, sp;
for(i = 1; i <= 24; i++)
{
for(sp = 24; sp >= i; sp--)
{
printf(" ");
}
for(j = 1; j <= i; j++)
{
printf("*");
}
printf("\n");
}
getch();
} |
C | #include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
// Creation et / ou ouverture du fichier param.h
void Initialisation()
{
FILE *f = NULL;
system("md param.h");
f=fopen("param.h/param.h.ino", "w");
if (f!=NULL)
{
}
else
{
printf("L'ouverture du fichi... |
C | /*
* This file is part of the SmokeOS project.
* Copyright (C) 2015 <Fabien Bavent>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, ... |
C | #include "bstree.h"
#include <stdio.h>
#include <stdlib.h>
BSTNode *BSTSearch(BSTree r, BSTDataType x)
{
BSTNode *p;
p = r;
if(r == NULL)
{
return NULL;
}
while(p != NULL)
{
if(p->data.key == x.key)
{
return p;
}
if(p->data.key < x.key)
... |
C | #include <kernel/page-alloc.h>
#include <kernel/printf.h>
#include <string.h>
static void test_page_alloc_small(void)
{
printf("%s\n", __func__);
void *page1 = page_alloc_small();
void *page2 = page_alloc_small();
void *page3 = page_alloc_small();
page_free_small(page1);
page_free_small(page2);
page_free_small(... |
C | //
<<<<<<< HEAD
// Created by Mrz355 on 23.03.17.
//
#define _XOPEN_SOURCE 1000
#include <ftw.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include <wait.h>
#include <sys/resource.h>
#include <errno.h>
extern char ** environ; // array of all the environment var... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[],char *env[])
{
int i;
printf("El valor de argc es: %d\n",argc);
for(i=0; i<argc; i++)
{
printf("El argumento %d es: %s\n",i,argv[i]);
}
printf("\n\n----------------------------------------------------------... |
C | #ifndef __LIST_H
#define __LIST_H
//this is the generic linked list node
struct generic_list_t {
void * data;
struct generic_list_t * next_node;
struct generic_list_t * previous_node;
};
//use create list, when you are creating the root node
void create_list(void *root_node_data);
void generic_list_add... |
C | #include "spi.h"
#include "led.h"
//initialize the SPI bus
void spi_init(spi_setting_t* settings) {
//set outputs
SPI_DDR |= (_BV(SPI_MOSI_PIN) | _BV(SPI_SCK_PIN));
SPI_DDR &= ~(_BV(SPI_MISO_PIN));
// enable pull-ups
SPI_PIN |= (_BV(SPI_MISO_PIN));
//set inputs
SPI_DDR &= ~_BV(SPI_MISO_PIN);
SPI_PORT ... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
struct Stats {
float health;
float healthRegen;
unsigned int mana;
float manaRegen;
float range;
float attackDamage;
float armor;
float attackSpeed;
float magicResist;
unsigned int movementSpeed;
};
struct Champion {
char name[20];
str... |
C | /* s1250183 Yuki Homma */
/* new version -- malloc */
/* ----- constraint ------- */
/* | 2<=N<=200, 1<=M<=100 |*/
/* | 0<=x,y<=1000, P=0, Q=0 |*/
/* ------------------------- */
#include <stdio.h>
#include <stdlib.h>
#include "func.h"
#include "input.h"
#include "point.h"
#define PQ 2
#define NMAX 200
#define MM... |
C | /*
** cmd.c for in /home/thauvi_a/rendu/psu/PSU_2016_myftp/src
**
** Made by Alexandre Thauvin
** Login <thauvi_a@epitech.net>
**
** Started on Sun May 21 17:16:20 2017 Alexandre Thauvin
** Last update Sun May 21 17:16:22 2017 Alexandre Thauvin
*/
#include "ftp.h"
void cwd(t_cmd *cmd)
{
if (chdir(cmd->cmd[1])... |
C | // Example of Root Tformula class:
{
TCanvas *c1= new TCanvas("c1", "c1",1500,500);
c1->Divide(3,1); //Three columns and one row
c1-> cd(1);
f1=new TF1("f1","sin(x)",0,5);
f1->SetLineColor(kBlue+2);
f1->SetTitle("Func1; X Axis Title; Y(miles)");
f1->Draw();
c1->cd(2);
f2=new TF1("f2", "cos(x)", 0,5);
f2->S... |
C | #include <stdio.h>
void Func302(){
int i;
for(i=0; i<256; i++){
printf("%d - %c, ",i,i);
}
scanf("%d",&i);
} |
C | #include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include <omp.h>
#include "main.h"
#include "estimate_root.h"
void using_estimate_root()
{
progress_zero();
for (uint32_t a = 1; a < max; a += 2) {
const __uint128_t a4 = pow4b(a);
# pragma omp parallel for
for (uint3... |
C | #include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include "structs.h"
#include "calculs.h"
#include "io.h"
Polynome * poly;
Polynome * polyList[128];
unsigned int currentId = 0;
void poly_init(Polynome ** _poly, double coef, int degre)
{
*_poly = malloc(sizeof(P... |
C | #include <stdio.h>
#include <stdlib.h>
void main()
{
char buffer[80];
FILE *stream;
stream=fopen("c:\\config.sys","w");
if (stream==NULL)
{
printf("File open error\n");
exit(1);
}
fgets(buffer,80,stream);
if (ferror(stream))
{
printf("file I/O error is occured\n");
printf("operation failed\n");
}
else p... |
C | /*Write a function that returns the index of the largest value stored in an array-of- double .
Test the function in a simple program.*/
#include<stdio.h>
#define SIZE 5
int max(double *array, int size);
int main(void)
{
double array[SIZE] = {1.1, 2.2, 3.3, 4.4, 5.5};
printf("The index of the largest value is... |
C | double integral(double (*f)(double x), double a, double b)
{
double sum, dt;
int i;
// Numerical integration: 0th order approximation
sum = 0.0;
dt = (b - a) / 100.0;
for (i = 0; i < 100; i++)
sum += (*f)(i * dt + a) * dt;
return sum;
} |
C | #include "kjob.h"
#include "header.h"
#include "bg_proc_list.h"
void kjob(char *command) {
char *buf = (char *) malloc(sizeof(char) * strlen(command));
strcpy(buf, command);
int token_cnt = 0;
char *token = strtok(buf, " \t\r\n");
while (token != NULL) {
token_cnt++;
token = strtok... |
C | /*
This code was used to test the X-BEE module on TIVA board. The motors were also used in conjuction with the X-BEE.
The X-BEE just sends "fast" or "slow" according to the speed of the motors.
PORTS used are : PORT C4 for RX
PORT C5 for TX
PORTS used for motor are : PORT E4 and E5 for EN.
PORT A6 and A... |
C | #include <stdio.h>
#include <omp.h>
#include <stdlib.h>
#include <math.h>
void FirstMethod(int N);
void SecondMethod(int N);
void ThirdMethod(int N);
int main()
{
int N;
printf("Enter the number of iterations: ");
scanf("%d", &N);
printf("\nActual value of pi upto 20 digits: 3.14159265358979323846");
... |
C | /* ************************************************************************** */
/* */
/* :::::::: */
/* get_rules.c :+: :+: ... |
C | #include <stdio.h>
#include <math.h>
int main()
{
int n,sum=0,rem=0,cube=0,c;
printf("Enter a number :");
scanf("%d", &n);
c=n;
while(n!= 0)
{
rem=n%10;
cube=pow(rem, 3);
sum=sum+cube;
n=n/10;
}
if (sum==c)
{
printf ("The given number is an ar... |
C | /*
* Set/Get rounding mode wrapper function for R
*
* Copyright 2010,2011 Gianluca Amato
*/
#include <fenv.h>
#include "ieeeround.h"
#include "R.h"
/* #define DEBUG */
void r_fegetround(int *rounding_mode)
{
#ifdef DEBUG
warning("Starting _r_fegetround. Rounding mode input is %d\n",*rounding_mode);
#endif
... |
C | // regex_match example
#include <iostream>
#include <string>
#include <regex>
int main ()
{
if (std::regex_match ("subject", std::regex("(sub)(.*)") ))
std::cout << "string literal matched\n";
const char cstr[] = "subject";
std::string s ("subject");
std::regex e ("(sub)(.*)");
if (std:... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* check_clear.c :+: :+: :+: ... |
C | #include <stdio.h>
int count;
void hanoi_tower(char start, char end, char buf, int n);
int main() {
int n;
printf("Number of disks: ");
scanf("%d", &n);
hanoi_tower('A', 'C', 'B', n);
printf("Step count = %d\n", count);
}
void hanoi_tower(char start, char end, char buf, int n) {
if (n <= 0) r... |
C |
/* */
/* Program Name: tolower.c */
/* */
#include <stdio.h>
#include <ctype.h>
void main(void)
{
char *in_string;
int i;
printf("Enter a string: ");
scanf("%s",in_string);
for (i=0;(in_string[i]!=' ')&&(in_string[i]!='\0');i++) {
in_string[i]=tolow... |
C | #pragma once
#include "stdafx.h"
const int CHARSET_SIZE = 256;
char* String(const char* source);
/*
Implement an algorithm to determine if a string has all unique characters.
What if you can not use additional data structures?
*/
bool IsAllUnique(const char* str);
/*
1.2 Write code to reverse a C-Style String.
(... |
C | #include<stdio.h>
main()
{
int m;
printf("enter the student marks: ");
scanf("%d",&m);
if(m<=60)
printf("grade F");
if((m>60)&&(m<=63))
printf("grade D-");
if((m>=64)&&(m<=67))
printf("grade D");
if((m>=68)&&(m<=70))
printf("grade D+");
if((m>=71)&&(m<=73))
printf("grade C-")... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
C | /* *========* *** *==============================================
* 联络信箱: *** :guwenjun2017@gmail.com
* 文档用途: *** :CII实验报告
* 修订时间: *** *2017年第41周 10月15日 星期日 下午11:06 (288天)
* *========* *** *============================================== */
#include <stdio.h>
int main(int argc, char **argv)
{
int num1;
... |
C | #include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#define TIME_BREAK 2
void error(char *mes);
int main(int argc, char *argv[])
{
if (argc != 4)
{
error("wrong number of arguments, try ./producer [pipe path] [text file] [number of chars]");
}
int... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include "base.h"
#include "extras.h"
#include "record.h"
#define MAX_RECORDS 100
// function prototypes
int input_handler(char[], Record[], int);
void display_menu();
// main function
int main() {
int entire_num = 0;
Record records[MAX_R... |
C | #include "calibrate_lcd.h"
extern Stack stack;
unsigned char calibrating;
const unsigned int MAX_TRIES = 10;
int offset_x;
int offset_y;
unsigned short zero_x, zero_y;
unsigned short max_x, max_y;
void calibrate_lcd(){
unsigned short hits_x[MAX_TRIES], hits_y[MAX_TRIES];
calibrating = 1;
char bu... |
C | #include <math.h>
#include <stdio.h>
#define PI 3.14159
double area(double radius);
double circumference(double radius);
int main(void){
double radius;
printf("Please enter a the radius of the circle\n");
scanf("%lf", &radius);
printf("The area of the circle is:%lf \n", area(radius));
printf("The circumfere... |
C | #include <stdio.h>
int main()
{
int i,r,max,a[10];
scanf("%d",&r);
for(i=0;i<r;i++)
{
scanf("%d",&a[i]);
}
max=a[0];
for(i=0;i<r;i++)
if(max<a[i])
max=a[i];
{
printf("%d",max);
}
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
struct node
{
int data;
struct node* left;
struct node* right;
};
struct node* GetNewNode(int x)
{
struct node* newNode;
newNode=(struct node*)malloc(sizeof(struct node));
newNode->data=x;
newNode->left=NULL;
newNode->right=NULL;
}
struct node* root=NULL;
struct node* In... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/shm.h>
#include <sys/sem.h>
#include <sys/ipc.h>
#include <sys/types.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <sys/time.h>
#include <time.h>
#include <math.h>
#include "my_queue.h"
int running = 1;
int X, K, M;
pid_t loaders[10];
v... |
C | /*
* rtc and date/time utility functions
*
* Copyright (C) 2005-06 Tower Technologies
* Author: Alessandro Zummo <a.zummo@towertech.it>
*
* based on arch/arm/common/rtctime.c and other bits
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public L... |
C | /*
* epedit.c
*
* Binary file editer program
*
* Author - John Kent
*
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <malloc.h>
extern main( int argc, char *argv[]);
/*
* equates
*/
#define FALSE 0
#define TRUE !FALSE
/*
* Commnad line buffer
*/
#define CMD_LINE_M... |
C | /* dir.c */
#include <stdlib.h>
#include <stdio.h>
#include <dirent.h>
#include <limits.h>
#include <unistd.h>
long get_path_max() {
long path_max = pathconf(".", _PC_PATH_MAX);
if (path_max == -1) {
return 1024;
}
return path_max;
}
int main(int argc, char* argv[]) {
char* cwd;
DIR* d... |
C | #ifndef __IR_H
#define __IR_H
#include "os_type.h"
// --------------------------------------------------------------------------------
// Sensor initialization flags
typedef enum {
// Attach sensor GPIO interrupts automatically.
// If not used, ir_handle_interrupt must be called manually.
IR_FLAG_INTERRUPTS = 0x1... |
C | #include "stdio.h"
#include <stdlib.h>
void ShellSort(int* nums,int len)
{
int increment = len;
int i,j;
do {
for (i = increment + 1;i < len;i++)
{
if (nums[i] < nums[i - increment])
{
nums[0] = nums[i];
for (j = i - increment;j > 0 && nums[j] > nums[0];j = j - increment)
{
... |
C | //LeeKwonHyeong lkh116@snu.ac.kr
/*
* trans.c - Matrix transpose B = A^T
*
* Each transpose function must have a prototype of the form:
* void trans(int M, int N, int A[N][M], int B[M][N]);
*
* A transpose function is evaluated by counting the number of misses
* on a 1KB direct mapped cache with a block size of ... |
C | #include<stdio.h>
int main (void)
{
int i,j=0;
scanf("%d",&i);
while(i!=1)
{
if (i%2==0){
i=i/2;
}
else{
i=((3*i)+1)/2;
}
j++;
}
printf("%d",j);
return 0;
}
|
C | /**
Copyright (c) 2020 Yue Zhao @ElegantSolution <eesoto@foxmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to us... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strsplit.c :+: :+: :+: ... |
C | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward d... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include "MQTTClient.h"
#define CLIENTID "temperature"
#define QOS 0
char* address = "tcp://localhost:1883";
MQTTClient client;
double get_temp() {
// Aquí se debiera obtener la temperatura del sensor
... |
C | #include <gtk-3.0/gtk/gtk.h>
#include <stdio.h>
#include "cypher.h"
#include<string.h>
GtkWidget *entry_str_label;
GtkWidget *key_str_label;
GtkWidget *opt_str_label;
GtkWidget *window;
GtkWidget *encrypt_btn;
GtkWidget *decrypt_btn;
GtkWidget *grid;
GtkWidget *entry_string;
GtkWidget *key_string;
GtkWidget *status_la... |
C | //OMKAR BELLARE
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <netinet/in.h>
#include <errno.h>
#include <string.h>
#include <sched.h>
#include <signal.h>
#include <pthread.h>
#include <signal.h>
#include... |
C | /*JSTK-320111
a1_p5_m1.c
Tudor Cristian Maiereanu
tumaierean@jacobs-university.de*/
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a = 478;
float b= -29.7949954;
char c='j';
double d=946.3969843;
printf ("The value of a over 9 places is %9d\n", a ) ;
printf ("The value of... |
C | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <regex.h>
#include "alloc.h"
#include "strstring.h"
/* define global flags */
int SS_REPLACE_ALL = 0x01;
char *
strnew(const char *string)
{
return strnnew(string, strlen(string));
}
char *
strnnew(const char *string, size_t len)
{
char *s = (ch... |
C | /*
* Alejandra Chávez Cruz
* A01411970@itesm.mx
* 7/sept/18
*/
#include <stdio.h>
#include <math.h> // This library includes the pow function
int main() {
//Declare the variables
double pi;
int v;
pi=0;
printf("Write how many decimals do you want ");
scanf("%d", &v);
... |
C | #include<stdio.h>
int main(){
long long n,p,c,d,a[1000],t,i;
while(1){
scanf("%lld",&n);
if(n==0)break;
c=0;
p=0;
t=0;
while(n!=0){
d=n%2;
if(d==1)c++;
a[t]=d;
t++;
n=n/2;
}
... |
C | #include <stdio.h>
#include <stdlib.h>
#include "grafo.h"
TG * criaGrafo(char * nomeArq);
TG * salvaNo(TNo * no);
int orientado(TG*g); //verifica se eh orientado (1) ou nao orientado(0)
int conexo(TG * g); //verifica se eh conexo
int colorir(TG * g);
void descolorir(TG *g); ... |
C | /* This program shows the weekday of a certain date.
* It is a small program I wrote in the cource of "C Programming" in 2010.
*
* COMPILATION: gcc -o 06_weekday 06_weekday.c
*/
#include<stdio.h>
int main()
{
int year,month,day,year_i,sum=0,i;
printf("Please input the date in the following form:'YEAR.MONTH.DAY'... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_free.c :+: :+: :+: ... |
C | /*
* Copyright (c) 2019-2020 Kevin Townsend (KTOWN)
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @defgroup VECTORS Vectors
*
* @brief Vectors functions
*
* TODO: Expand with examples, better high-level documentation, etc.
*/
/**
* @file
* @brief API header file for vectors in zscilib.
*
* This file ... |
C | /**
* @file main.c
* @mainpage IaP - CT0441-1 (CT3) 2020-21 - MiniLaska
* @section intro_sec Introduzione
*
* Gli studenti sono stati chiamati a sviluppare, in linguaggio ANSI C, miniLaska, una variante del gioco originale http://www.lasca.org/.
* <br> Rispetto al gioco originale, miniLaska prevede le seguenti limitazi... |
C |
#include "serialclient.h"
#include <inttypes.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>
// install path: /usr/lib/avr/include/avr
#include <util/delay.h>
#include <avr/io.h>
#include <util/setbaud.h>
#include <stdio.h>
#include "lib_serial.h"
// direction
// ADR (analog direction r... |
C | //NOMBRE:Ramón Sieira Martínez
//Ejercicio-Optimizacion
//Grupo del X(16:30-18:00)-J(18:00-19:30)
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
void formaestatica()
{
clock_t start,end;
double time;
start=clock();
//int matriz[10000000][100];
int i=0;
int j=0;
/*for(i=0;i<100;i++)
{
f... |
C | #include <stdio.h>
#include "matrix.h"
int main(char argc, char** argv)
{
int** matrix;
int rows, cols, init;
rows = 3;
cols = 4;
init = 5;
matrix = create_matrix(rows, cols, init);
destroy_matrix(matrix);
return 0;
}
|
C | #include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "stdbool.h"
typedef struct node {
int data;
int key;
struct node *next;
struct node *prev;
}N;
N *head = NULL;
N *last = NULL;
N *current = NULL;
bool isEmpty(){
return head == NULL;
}
int length(){
int length = 0;
N... |
C | /* xemote.c - a little toy to add extra things to says and emotes-
* notably colored says, and color inside double quotes
* in emotes. It also adds a pemote command, which is the
* same as emote except it adds "'s" after the name of the
* emoting person.
* Illario... |
C | //
// Created by Nils on 02.10.2019.
//
#include "arrayz.h"
#include <stdio.h>
#include <stdlib.h>
typedef struct {
void* next;
void* value;
} list_entry;
typedef struct {
list_entry* start;
int size;
} list;
typedef void (*each_callback)(list_entry*, int);
list* init_list(){
list* lst = mall... |
C | #ifndef CPU_RAND_H__
#define CPU_RAND_H__
struct cpu_rand_state {
unsigned int seed;
};
inline void cpu_rand_init(unsigned int seed, struct cpu_rand_state &empty_state) {
empty_state.seed = seed;
srand(seed);
}
inline double cpu_rand_generate(struct cpu_rand_state &state) {
return (((double)rand_r(&(... |
C | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
#define MAX 200
typedef struct projeto{
int code;
char title[42];
char Descricao[42];
char year[42];
char status[42];
char maneger[42];
char final_year[42];
char particants[42];
char investments[42];
}base_projects;
int posicao =... |
C | /*
* Control_Law.h
*
* Created on: 5 de mar de 2020
* Author: davia
*/
#ifndef CONTROL_LAW_H_
#define CONTROL_LAW_H_
typedef struct {
// Variáveis de Controle PD
int identification;
int dif_ruido;
float estimativa_motor;
float angulo_motor;
float kp_pd;
float kv_pd;
float m;
float b;
float k;
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.