language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /* Q15 Accept a no. the user and print the fibonacci series till that number*/
#include <stdio.h>
int main()
{
int a=0,b=1,c=1,n;
printf("Enter the no:");
scanf_s("%d",&n);
printf(" %d ",a);
for(;c<=n;)
{
c=a+b;
printf(" %d ",b);
a=b;
b=c;
}
getch();
return 0;
} |
C | /*
** EPITECH PROJECT, 2019
** lib
** File description:
** printab
*/
#include <stddef.h>
#include "lib.h"
void my_printab(char **tab)
{
size_t i = 0;
while (tab[i][0] == '\0')
++i;
while (tab[i] != NULL) {
my_putstr(tab[i]);
if (tab[i][0] != '\0')
my_putstr("\n");
... |
C | #include <stdio.h>
/**
* main - prints the name of the program
* @argc: integer, number of arguments
* @argv: vector, array of string
* Return: 0 (success)
*/
int main(int argc __attribute__((unused)), char **argv)
{
printf("%s\n", *argv);
return (0);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#define FALSE 0
#define TRUE 1
typedef struct human{
char name[10];
int age;
float salary;
}human;
int humanEqual (human *person1, human *person2)
{
if (strcmp((*person1).name, (*person2).name)) return FALSE; //()Ѵٲ. ȱ ׳ -> ᵵ ǰ
if ((*person1).age != (*pe... |
C | #include "binary_trees.h"
/**
* binary_tree_depth - find depth of a binary tree node
* @tree: pointer to node to measure
* Return: parent + 1 if tree and parent exists, or else 0
*/
size_t binary_tree_depth(const binary_tree_t *tree)
{
return (((tree) && (tree->parent)) ? binary_tree_depth(tree->parent) + 1 : 0);... |
C | #include <cs50.h>
#include <stdio.h>
#define _XOPEN_SOURCE
#include <unistd.h>
#include <string.h>
int string_length(char * element);
char next_letter();
char head = 0;
// Assuming there is only alphabetical characters, but it can go for any length / variation
char alphabet[53] = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghij... |
C | #include <signal.h>
#include <time.h>
#include <stdio.h>
#include <errno.h>
/*
int timer_create(clockid_t clockid, struct sigevent *sevp, timer_t *timerid);
Link with -lrt
clockid can be
CLOCK_REALTIME
CLOCK_MONOTONIC
CLOCK_PROCESS_CPUTIME_ID //process consumed time
CLOCK_THREAD_CPUTIME_ID //thread consume... |
C | #include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <pthread.h>
void in_to_out() {
char buffer[8192];
if (argc==1) {
int n = read(0, buffer, 8192); // 8kb is the most optimal buffer size
while(n!=0) {
write (1, buffer, n); // only the number of byte... |
C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef struct BinaryTreeNode{
char data;
struct BinaryTreeNode* leftChildPtr;
struct BinaryTreeNode* rightChildPtr;
}BinTreeNode;
typedef struct BinaryTree{
struct BinaryTreeNode* rootNodePtr;// 이거 선언할 때 BinaryTreeNode 라고 안하고 구조체 선언변수 BindTreeN... |
C | #include "serv.h"
/*********** GLOBALS DECLARATION ************/
struct packet *in_seq_buffer[BUFFER_SIZE];
unsigned long wait_period;
main()
{
pthread_t recv_pkts, process_enq;
int iResult;
iResult =
pthread_create(&recv_pkts, NULL,
(void *)recieve_packets_thread_function, NULL);
if (iResult != 0) {... |
C | #include "hx711.h"
#include "delay.h"
#define filter_times 2
long Init_Gross_Weight=0; //ʼƤ
long All_Weight=0; //
long Gross_Weight = 0;
long Net_Weight = 0;
u8 Flag_Error=0;
/* ----------------------------- */
/* HX711 ʱ */
/* ----------------------------- */
void Hx711_Delay()
{
__NOP(); ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdint.h>
int main(int argc, char *argv[])
{
// Check if there is 1 and only 1 CLA
if(argc != 2)
{
fprintf(stderr, "Invalid input. Only 1 file accepted.\n");
return 1;
}
char *infile = argv[1];
FILE *inptr = fopen(i... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <math.h>
#include "cic.h"
void cic_init(CIC * cic, double BoxSize, int Ngrid, int ViewSize[3]) {
int k;
size_t last = 1;
cic->CellSize = BoxSize / Ngrid;
cic->BoxSize = BoxSize;
for(k = 0; k < 3; k++) {
cic->strides[2 - k] ... |
C | #include "usart.h"
#include "cbuf.h"
#include <avr/interrupt.h>
//our transmit and receive buffers
static uint8_t tx_buf[DEFAULT_BUF_SIZE];
static volatile cbuf_t usart1_tx;
static uint8_t rx_buf[DEFAULT_BUF_SIZE];
static volatile cbuf_t usart1_rx;
#define INPUT_BUFFER_SIZE 40
static uint8_t usart_input[INPU... |
C | #include<stdio.h>
#include<conio.h>
#define MAX 50
int queue[50], endOfQueue = -1, startOfQueue = -1;
void enqueue()
{
int data;
if(endOfQueue == MAX-1)
printf("Queue is full\n");
else
{
if(startOfQueue == -1)
startOfQueue = 0;
printf("Enter Integer Value:\n");
scanf("%d",&data);
endOfQueue++;
queue... |
C | /*
(5) Create a program for the following (originally from Absolute C++)
File must be called: finalist.c
“You have four identical prizes to give away and a pool of 25 finalists. The finalists are
assigned numbers from 1 to 25. Write a program to randomly select the numbers of 4
finalists to receive a prize. Mak... |
C | /*
Autor: pmarze
Compilador: 9.2.1
Compilado: gcc Lab4_4.c -o Lab4_4 -lm
Fecha: dom mar 29 19:10:39 CST 2020
librerias: stdio, math, stdio_ext
Resumen: El programa recibe dos matrices de 3x3
y también una constante, el programa realiza
las siguientes operaciones y muestra el resultado.
Las operaciones a realizar son... |
C | #include "../inc/ft_printf.h"
void init_flags(*p)
{
t_flags f;
while (is_conv(*p->fmt) == 0)
{
f.hash = *p->fmt == '#' ? 1 : 0;
f.zero = *p->fmt == '0' ? 1 : 0;
f.neg = *p->fmt == '-' ? 1 : 0;
f.pos = *p->fmt == '+' ? 1 : 0;
f.spc = *p->fmt == ' ' ? 1 : 0;
p->fmt++;
}
p->f = &f;
}
|
C | /* strcatstrncat̗p */
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[16];
char *x = "ABC";
strcpy(s, "QWE"); /* s"QWE"ƂȂ */
strcat(s, "RTY"); /* s"QWERTY"ƂȂ */
printf("s = %s\n", s);
strcpy(s, x); strncat(s, "123", 1); printf("s = %s\n", s);
strcpy(s, x); strncat(s, "123",... |
C | // ****************************************************************************
// * *
// * GESTIONNAIRE DE CONTACT *
// * ... |
C | //
// Created by Kamil on 2019-03-11.
//
#include <stdio.h>
#include <string.h>
#include "utilieties.h"
struct Configuration read_args(int argc, char *argv[]){
Configuration result = {};
char protocol[3];
sscanf(argv[1], "%s", result.userId);
sscanf(argv[2], "%d", &result.listeningPort);
sscanf... |
C | #include "draw.h"
void drawMenu(char ** names, u8 * done, u8 * errors, u32 selected_entry)
{
for (u8 i = 0; i <= 40; i++) {
printf("\x1b[0;40;37m\x1b[5;%uH=", (4+i));
printf("\x1b[0;40;37m\x1b[24;%uH=", (4+i));
}
for(u32 i = 0; i < 18; i++) {
char format[64];
sprintf(format, "\x1b[%lu;4H", (i+6));
if... |
C | #include "WebGraph.h"
#include "StrHT.h"
#include "IntList.h"
#include "boolean.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _page {
char *url; // points to a string in StrHT "urls"
IntList outlinks; // reference indices in webGraph's pages[] array
}page;
typedef s... |
C | //
// main.c
// Trigonometric
//
// Created by Niklas Sauer on 24.04.17.
// Copyright © 2017 DHBW Stuttgart. All rights reserved.
//
#include <stdio.h>
#include <math.h>
// global definitions
#define MAX_DIFF 0.00001
#define PI 3.141592653589793238462643383279502884197169399375105820974
#define PI_2 ... |
C | #ifndef DS3234_RTC_h
#define DS3234_RTC_h
#include <SPI.h>
#include "Common.h"
#include "RGB.h"
int RTC_init(){
// Initialize the real-time-clock
pinMode(RTC_SELECT,OUTPUT); // chip select
// start the SPI library:
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(SPI_MODE1); // both mode 1 & 3 s... |
C | /* to help make the code clearer */
#define CX 0 /* columns */
#define CY 1 /* rows */
#define CZ 2 /* planes */
#define getidx(x,y,z,nx,ny,nz) ((nx)*(ny)*(z) + (nx)*(y) + (x))
#define split(idx,x,y,z,nx,ny,nz) {\
int tmp = idx % ( (nx)*(ny) ); \
(x) = tmp % (nx); \
(y) = tmp / (... |
C | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(void)
{ //0123456789012345678
char date[] = "2020-06-23 02:09:21";
struct tm t= { 0, };
t.tm_sec = atoi(&date[17]);
date[16] = 0;
t.tm_min = atoi(&date[14]);
date[13] = 0;
t.tm_hour = atoi(&date[11]);
date[10] = 0;
t.tm_mday = atoi(&date[8... |
C | #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct node
{ int rollno;
char name[15];
struct node *nxt;
}*head,*newnode,*prenode,*ptr;
void addnode()
{ if(head==NULL)
{ head=(struct node *)malloc(sizeof(struct node));
printf("Enter Roll No. : ");
scanf("%d",&head->rollno);
p... |
C | #include <stdio.h>
int Hash(unsigned long long key, int buckets)
{
long long b = -1;
long long j = 0;
while (j < ((long long) buckets))
{
b = j;
key = key * 2862933555777941757 + 1;
j = ((long long) (((double) (b + 1)) * (((double)(((long long) 1) << 31)) / ((double)((key >> 33... |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main2()
{
char a = -128;
printf("%u\n", a);//4294967168
char b = 128;
printf("%u\n", b);//4294967168
//%u ʮcharint
//Ϳa/bͣΪзǰȫ1
system("pause");
return 0;
} |
C | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct node{
struct node *pre;
int data;
struct node *next;
};
struct node *head,*head1,*ptr,*ptr1,*ptr2,*ptr3;
void main()
{
clrscr();
int n,i,a,b,c,d;
printf("input your first data\n");
scanf("%d",&n);
ptr=(node *)malloc(sizeof(node));
head=ptr;
ptr->pre=N... |
C | /*
* Calculates pi with the Gregory-Leibniz series on an OpenCL device
*
* Adapted from the Map-reduce example.
*
*
* - Andy MacGregor
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
#ifdef AOCL
#include "CL/opencl.h"
#... |
C | #include <string.h>
#include <stdint.h>
#include "include/cache.h"
//Per file cluster improves performance
//Requires some memory space
//============================================================================
// fat_cache_init:
//============================================================================
int f... |
C | #include <stdio.h>
#include "tipsydefs.h"
#include <rpc/types.h>
#include <rpc/xdr.h>
/* Sanitiy check to be sure all data is written */
int
main()
{
struct gas_particle gas;
struct dark_particle dark;
struct star_particle star;
int i;
XDR xdrs;
struct dump header;
double mass_min, mass_ma... |
C | #include <stdio.h>
int main()
{
int n, i, sum;
sum = 0;
printf("give n: ");
scanf("%d", &n);
for(i=0; i<=n; i++)
{
sum = sum + i;
}
printf("the sum of the first %d numbers is : %d", n, sum);
return 0;
}
|
C | //
// main.c
// 7_05
//
// Created by Wonkeun No on 2020-04-17.
// Copyright © 2020 genne. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
#include "arrayheap.h"
void displayArrayHeap(ArrayMinHeap* pHeap) {
int i = 0;
if (pHeap != NULL) {
for (i=0; i <= pHeap->currentElementCount; i... |
C | /*
* IFJ17 Compiler Project, FIT VUT Brno 2017
*
* Authors:
* Erik Kelemen - xkelem01
* Attila Lakatos - xlakat01
* Patrik Sober - xsober00
* Tomas Zubrik - xzubri00
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "string.h"
#define ALLOC_ERROR 60
#define DEFAULT_STR_ALLOC ... |
C | #include <stdio.h>
enum months {Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec};
typedef struct {
char name[10];
int kor, eng, math, tot;
float ave;
}SCORE;
typedef union {
char ch;
int i;
double d;
}TYPE;
int main(void)
{
SCORE a;
TYPE b;
b.i = 0xFFFFFFFF;
printf("a : %d \n", sizeof(a));
printf("a... |
C | #include<stdio.h>
#include<stdlib.h>
int main()
{
system("clear");
int N,count=0;
printf("Program to print squares up to N \n");
printf("Enter N\n");
scanf("%d",&N);
/*for (int i = 1; i*i <= N; i++)
{
count++;
}*/
//printf("%d\n", count);
for (int i... |
C | /*E10.27*/
#include<stdio.h>
void func1(char x[]);
void func2(char x[]);
int main(void)
{
char arr[5];
puts(arr);
func1(arr);
puts(arr);
func2(arr);
puts(arr);
return 0;
}
void func1(char x[])
{
x="Jack";
puts(x);
}
void func2(char x[])
{
x[0]='J', x[1]='i', x[2]='l', x[3]... |
C | #include "../stack.h"
#include <stdio.h>
#include <stdlib.h>
int main(){
t_stack *stack = newStack();
double x=3,y=1,z=2;
push(stack, &x, t_double);
push(stack, &y, t_double);
push(stack, &z, t_double);
double saindo = popDouble(stack);
while(saindo != 0){
printf("%lf\n", saindo);
... |
C | #include<stdio.h>
void main()
{
int a[10],i,j,n,t,k;
printf("\n enter the limit");
scanf("%d",&n);
printf("\n enter the elements");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<n;i++)
{
k=a[i];
j=i-1;
while(j>=0 && a[j]>a[j+1])
{
a[j+1]=a[j];
a[j]=k;
j--;
}
}
printf("Inser... |
C | /*
* Opdracht.c
*
* Created: 13/02/2021 13:30:59
* Author : Wouter
*
* Kleine bug, wanneer de richting veranderd wordt duurt het n cycle tot dit wordt toegepast.
*
*/
#include <avr/io.h>
#include <util/delay.h>
void setLed(uint8_t led, uint8_t state);
int buttonPressed();
uint8_t pressed = 0;
int main(void... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <sys/ipc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define HELLO_DRIVER_NAME "/dev/hello"
int main(int argc, int **argv)
{
char data[4] = {0,};
int fd;
... |
C | #include <stdio.h>
#include <stdlib.h>
#include "helper.h"
void reverse(char *str, int strlen)
{
//reverse_str(str, strlen);
char ch;
for(int i = 0; i < strlen / 2; ++i){
ch = str[i];
str[i] = str[strlen - i - 1];
str[strlen - i - 1] = ch;
// swap(str[i], str[strlen - i - 1]);
}
}
|
C | #include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
int main(void)
{
int i, j;
int fd;
char nums[7];
struct tm *tm_ptr;
time_t the_time;
fd = open("/dev/fpga_segment", O_WRONLY);
assert(fd >= 0);
for (;;)
{
for (i = 0; i < 20; ++i)
{
(void) time(&the_time);
t... |
C | typedef struct Vec2_
{
f32 x;
f32 y;
} Vec2;
static inline
Vec2 v2(f32 x, f32 y)
{
Vec2 v;
v.x = x;
v.y = y;
return v;
}
static inline
Vec2 v2_add(const Vec2* a, const Vec2* b)
{
Vec2 v;
v.x = a->x + b->x;
v.y = a->y + b->y;
return v;
}
static inline
Vec2 v2_add_scaled(const Vec2* a, const Vec2* b, f32 f)
... |
C | #include <immintrin.h>
#include "e2.h"
// ---------------------------------------------------------------------
// count_occ
// ---------------------------------------------------------------------
// SSE version
int count_occ(const char* v, int n, char x) {
int i, cnt = 0;
unsigned char mc[16];
__m128i a, ... |
C | #include <signal.h>
#include <stdlib.h>
#include <stdio.h>
int attente;
int sigpere;
int sigfils;
void captpere (int signum)
{
printf("SIGINT PERE restait %d sec.\n",attente);
if(sigpere==3)
exit(0);
sigpere++;
}
void captfils (int signum)
{
printf("SIGINT FILS\n");
rectvert(2);
if(si... |
C | #include<stdio.h>
#include<stdlib.h>
#define MAX 20
int stack[MAX], top = -1;
void push();
void pop();
void show();
int main()
{
int ch;
while(1)
{
printf("\n1.Push \n2.Pop \n3.Show \n4.Exit \n");
printf("\nEnter your choice : ");
scanf("%d", &ch);
switch(ch)
{
case 1: push();
break;
case 2: pop... |
C | /* vim: set ft=c: */
/* All the memory management used throughout the tlua source code.
* The `alloc` struct implements:
* - stdlib-style malloc/realloc/free
* - lua-style malloc/realloc/free
* - obstack-style bump allocator
*
* The stdlib-style functions are used within flex and bison generated code.
* The lua-... |
C | #include "cards.h"
#include <string.h>
/*
Name: Kaitlin Meyer
Assignment: ICA 06
Class: CMPE 1700
Instructor: Oveeyn Moonian
*/
//functions
void GetName(cardSuit cS, cardValue cV, Card* C, char Suit[20], char Value[20]);
void main() {
//variables
cardSuit cS = 0;
cardValue cV = 2;
Card deckCards[52];
char st... |
C | #include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <commons/collections/dictionary.h>
#include "../defines.h"
#include "key-table.h"
struct key_table_data_t {
bool initialized;
struct instance_t *instance;
};
struct key_table_t {
t_dictionary *table;
pt... |
C | #include <stdio.h>
int n, used[9] = {0};
char num[9], result[9];
void recursive(int deep) {
int i;
if (deep == n) {
result[n] = 0;
puts(result);
return;
}
for (i = n - 1; i >= 0; i--) {
if (!used[i]) {
used[i] = 1;
result[deep] = num[i];
recursive(deep + 1);
used[i] = 0;
}
}
}
int main(voi... |
C | #include <stdio.h>
#include <malloc.h>
#include <string.h>
#include "Tweet.h"
#include "AVLRebalance.h"
#include "BinarySearchTree3.h"
#include "BinaryTree3.h"
#define BUF_SIZE 1000
#define WORD_SIZE 5000
#define JUST 0
#define ABOVE 1
int main(void)
{
static int totalUsers = 0;
static int totalTweets = 0;
stat... |
C | #include <stdio.h>
#include <pthread.h>
void *uno (void *arg){
printf("Sono il thread che esegue la funz. uno\n");
pthread_exit(0);
}
void due (void *arg){
printf("SOno il thread che esegue la funz. due\n");
pthread_exit(0);
}
int main(){
pthread_t t1, t2;
printf("Padre: creo 2 thread \n");... |
C | #include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <assert.h>
#include <openssl/ssl.h>
#include <openssl/bio.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
#include <openssl/evp.h>
//#define DEBUG
/* test whether the file exists */
int file_t... |
C | #define _GNU_SOURCE
#define _POSIX_SOURCE
#include <argp.h>
#include <limits.h>
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
static void fail(char* msg) {
printf("%s\n", msg);
exit(1);
}
/************************************************... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INICIO 0
#define MAX 1000
typedef struct{
char nomes[20];
}Celula;
typedef struct{
Celula criancas[MAX];
int first, last;
}Lista;
void Inicia(Lista *lista);
int insere(Lista *lista, int p, Celula x);
int retira(Lista *l... |
C | #include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include <errno.h>
pid_t pa;
sigset_t ms;
int nr;
struct sigaction a;
int total=0;
char* tabela;
//the encoded signals header (it prints out the char coresponding to the signal) and sends back SIGUSR... |
C | /* SenalProceso.c */
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#define TIMEOUT 30
/**
* Codigo manejador de seales
*/
void
manejador(int senal) {
fprintf(stderr, "Llego: %d\n", senal);
}
int
main(int argc, char *argv[]) {
/**
* Establece los manejadores de seales
*/
signal(SIGINT... |
C | /*
Z88DK base graphics libraries examples
Thue Morse sequence used to draw a fractal path
Demonstrates the use of bitwise operators in C and the 'turtle graphics' instructions
to build: zcc +<target> -lndos -create-app -llib3d thuemorse.c
$Id: thuemorse.c $
*/
#include <graphics.h>
#include <stdio.h... |
C | #include "libft.h"
int push_list_node(void *data, t_list *list)
{
t_list_node *node;
node = (t_list_node *)ft_memalloc(sizeof(t_list_node));
if (node == NULL)
return (-1);
node->data = data;
node->next = NULL;
if (list->head == NULL)
list->head = node;
if (list->tail != NULL)
list->tail->next = node;
l... |
C | #include "../defMacro.h"
/////////////////////////////////////////////
// Read the operators form files //
/////////////////////////////////////////////
void read_mat(float *MAT, int n1,int n2, char *file_name, char *SYM)
{
int nInd;
float FLT;
FILE *f;
char *pch;
char trash[100];
... |
C | /*
* Table des symboles.h
*
* Created by Janin on 12/10/10.
* Copyright 2010 LaBRI. All rights reserved.
*
* Associative array encoded as linked list of pair (symbol_name, symbol_value).
* To be used only with getter get_symbol_value and setter set_symbol_value.
*
* Symbol_value_type (defined in Attribut... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/can.h>
#include <linux/can/raw.h>
#include <time.h>
int main(int argc, char **argv)
{
int s;
int nbytes;
struct sockaddr_can addr;
struct ifreq ifr... |
C | #include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <cedille/kconfig.h>
#include <cedille/ktypes.h>
#include <cedille/text_console.h>
#include <cedille/kprocess.h>
#ifdef ARCHx86
#include <arch/x86/ports.h>
#endif
volatile uint8_t term_x = 0;
volatile uint8_t term_y = 0;
uint32_t sc... |
C | #include "sqlite3ext.h"
SQLITE_EXTENSION_INIT1;
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int test_counter = 0;
static void sql_tap_plan(
sqlite3_context *ctx,
int num_values,
sqlite3_value **values
) {
int nbr_tests = sqlite3_value_int( values[0] );
char *plan;
plan = sq... |
C | #ifndef UV_TCP_SERVER_PRIVATE_IS_DEFINED
#define UV_TCP_SERVER_PRIVATE_IS_DEFINED
#include "UvTcpServer.h"
/* A package that is attached to uv_handle_t structs.
* It contains server data, memory block data and user data.
* Handled internally only, and should not be seen by the user. */
typedef struct uscb_package
{... |
C | // ---------------------------
#include <stdio.h>
#include <stdlib.h>
#include "pattern_matching.h"
// ---------------------------
/*********************************************************************/
/****************************** TESTER: ******************************/
/**************************************... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char word[30];
char *errorCheck;
char *tempword;
long int numberOfWords = 0;
int index = 0;
int numberofbuckets = 1;
char * currentbucket;
char * previousbucket; //only exists to help with printing backwards
char * firstbucket;
/* Bucket... |
C | /*
7-38 支票面额 (15 分)
一个采购员去银行兑换一张y元f分的支票,结果出纳员错给了f元y分。采购员用去了
n分之后才发觉有错,于是清点了余额尚有2y元2f分,问该支票面额是多少?
输入格式:
输入在一行中给出小于100的正整数n。
输出格式:
在一行中按格式y.f输出该支票的原始面额。如果无解,则输出No Solution。
输入样例1:
23
输出样例1:
25.51
输入样例2:
22
输出样例2:
No Solution
98f = 199 y + n
*/
#include <stdio.h>
int main()
{
int n, i, j;
scanf("%d", &n);... |
C | #ifndef JEP_SERIAL_H
#define JEP_SERIAL_H
// This is the interface for serial port I/O.
// The intended purpose of these functions is debugging in a virtual machine.
/**
* Initializes a serial port.
* This must be called before any other functions in this interface.
*/
void k_serial_com1_init();
/**
* Writes a c... |
C | #include <stdio.h>
void minmax(int data[], int *min, int *max) {
for (int i = 0; i < 3; i++ ){
if (data[i] < *min) {
*min = data[i];
}
if (data[i] > *max) {
*max = data[i];
}
}
}
int main() {
int a[3];
int min;
int max;
printf("input 1st ... |
C | #include<stdio.h>
#include<stdlib.h>
int a, b, c, d, e,i,j,k;
int main()
{
int w = 0;
printf("J5Ӽ:"); scanf_s("%d%d%d%d%d",&a,&b,&c,&d,&e);
int q[5] = { a, b, c, d, e };
for (i = 0; i <5; i++)
{
if (q[0] < q[1] && q[1] < q[2] && q[2] < q[3] && q[3] < q[4])break;
for (j = 1; j <5; j++)
{
if (q[j-1] > q[j])... |
C | // programa que monstra binários em pontos flutuantes
#include <stdio.h>
int main (void)
{
int bits [32];
float aux ;
printf ("Digite o número ponto flutuante: \n ");
scanf ("%f" , &aux );
unsigned int *x;
x = &aux ;
for (int bit=0; bit<32; bit++ )
{
bits[31-bit]=(*x)... |
C |
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "options.h"
#include "parse.h"
#include "results.h"
#include "algorithms.h"
#include "database.h"
#include "output.h"
struct elocfb_options options;
struct arguments {
int argc;
char **argv;
int current;
char *file;
};
stat... |
C | #include "Aptree.h"
#include "Afunc.h"
Aptree_t Aptree_t::_null_pred_tree = Aptree_t::make_null_pred_tree ();
void Aptree_t::init (Afunc_t *f, int n, const Aptree_t *a)
{
// assume that user is in charge of deleting the
// old _func and _args.
_func = f;
assert ((_nargs = n) >= 0);
if (_nargs > 0)
{
... |
C | #include <stdlib.h>
#include <stdio.h>
int main(){
char* p1 = (char*)malloc(0x18);
char* p2 = (char*)malloc(0x48);
for(int i=0;i<0x18;i++){
p1[i] = 'a';
}
printf("%s\n",p1);
p1[0x19] = 0xff; // overflow!
free(p2);
}
|
C | /* data struct and its operations */
typedef struct DataNode
{
char* cmd;
char* desc;
int (*handler)();
struct DataNode *next;
} tDataNode;
/* find a cmd in the linklist and return the datanode poiont */
tDataNode* FindCmd(tDataNode * head, char * cmd);
/* show all cmd in linklist */
int ShowAllC... |
C | /*
* RCS info
* $Author: ccalvert $
* $Locker: $
* $Date: 2009/03/03 18:48:36 $
* $Id: dp_elev_mode9.c,v 1.2 2009/03/03 18:48:36 ccalvert Exp $
* $Revision: 1.2 $
* $State: Exp $
*/
#include "dp_elev_func_prototypes.h"
/******************************************************************************
Filenam... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* stack_rotate.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <string.h>
#include <math.h>
int main(int argc, char const *argv[]){
int conjunto_tam = strlen(argv[2]), tam_palavra, i, j, k, chave;
char *conjunto, ch;
sscanf(argv[1], "%d", &tam_palavra);
sscanf(argv[2], "%s", conjunto);
for(i = 1; i <= tam_palavra; i++){
for... |
C | #include<stdio.h>
void main()
{
int R,L,i;
scanf("%d", &L);
scanf("%d",&R);
for(i=L;i<=R;i++)
{
printf("%d ",i);
}
}
|
C | #include<stdio.h>
int main()
{
int a[10][10][10];
int x,y,z;//for loops
int i,j,k;
int counter=0;
printf("Enter tables,rows,columns : ");
scanf("%d,%d,%d",&x,&y,&z);
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
for(k=0;k<z;k++)
{
a[i][j][k] = ++counter;
}
}
}
printf("data : \n\... |
C | #include "merge_sort.c"
int SOMMA(int A[],int p, int x)
{
int i = p;
int j = 0;
while(j < i)
{
if((A[i]*A[i])+(A[j]*A[j]) == x*x) return 1;
else
{
if((A[i]*A[i])+(A[j]*A[j]) < x*x) j++;
else i--;
}
}
return 0;
}
int pitagora(int A[], int n)
{
int i,j,x;
if(n < 3) return 0;
merge_sort_ric(A,n);
... |
C | int menu(void)
{
int opt;
printf("Escolha a opcao\n");
printf("0. Sair\n");
printf("1. Zerar fila\n");
printf("2. Exibir fila\n");
printf("3. Adicionar Elemento na Fila\n");
printf("4. Retirar Elemento da Fila\n");
printf("Opcao: "); scanf("%d", &opt);
return opt;
}
void opcao(node *FILA, int op)
{
node *t... |
C | /*to write my own version of strncat*/
#include<stdio.h>
#include<stdlib.h>
int mystrncmp(char s1[],char s2[],int n)
{
int i,flag;
for(i=0;i<n;i++)
{
if(*(s1+i)==*(s2+i))
flag=0;
else
{
flag=1;
return *(s1+i)-*(s2+i);
}
}
if(flag==0)
{
return 0;
}
}
int main(void)
{
char*s1;
char*s2;
s1=(ch... |
C | /*
Author: Tsewei Peng
Class: CS444 - OS2
Concurrency homework #1
Resources used:
1) https://jlmedina123.wordpress.com/2013/05/03/pthreads-with-mutex-and-semaphores/
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include "mt19937ar.c"
#define BUFFER_SIZ... |
C | #include<iostream>
#include<stack>
using namespace std;
int main()
{
int n;
stack<int> a;
while(cin>>n){
while(n)
{
a.push(n&1);
n>>=1;
}
while(a.size())
{
cout<<a.top();
a.pop();
}
cout<<endl;
}
retur... |
C | /*Elems, por Juan Ureña.
El programa recibe una lista de parámetros,
intentará sacar la variable de entorno de cada
parámetro. El resultado de cada una se imprimirá,
separando cada valor (valores separados por los
dos puntos). En el caso de que se pase un
parámetro que no es varible de entorno, el
programa acabará co... |
C | #ifndef __SEAL_ARRAY_H__
#define __SEAL_ARRAY_H__
typedef enum
{
BYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, FLOAT, DOUBLE, OTHER
} TYPE;
void SEALArray_Map(void *array, void (*function)(void *arg), int length, TYPE type);
int SEALArray_Sort(void *array);
int SEALArray_Reverse(void **array);
void * SEALArray_... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing_utils.c :+: :+: :+: ... |
C | //
// File descriptors
//
#include <mmu.h>
#include <cdefs.h>
#include <defs.h>
#include <param.h>
#include <fs.h>
#include <spinlock.h>
#include <sleeplock.h>
#include <file.h>
#include <proc.h>
#include <stat.h>
#include <fcntl.h>
#include <memlayout.h>
#include <buf.h>
struct devsw devsw[NDEV];
struct {
struct ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <conio.h>
#include "sort.h"
#define ArraySize 10
void PrintArray(int a[], int size) //debug
{
int i;
for (i = 0; i < size; i++)
printf(" %5d ", a[i]);
printf("\n--------------------\n");
}
void InitArray(int a[... |
C | /* macptopbm.c - read a MacPaint file and produce a portable bitmap
**
** Copyright (C) 1988 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies ... |
C | /*
* tasks.c
*
* Created on: 21 июн. 2018 г.
* Author: moskvin
*/
#include "tasks.h"
//-----------------------------------------------------------------------------
// functions
//-----------------------------------------------------------------------------
/**
* does nothing, for example only
* @param p... |
C | #include<stdio.h>
int main()
{
int sayi;
printf("Lutfen 0-9 arasinda bir sayi giriniz: ");
scanf("%d,",&sayi);
switch(sayi)
{
case 0:
printf("Sifir");
break;
case 1:
printf("Bir");
break;
case 2:
printf("Iki");
break;
case 3:
printf("Uc");
break;
c... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "material.h"
#include "tree.h"
#include "fileControl.h"
#define file "arvore.bin"
void initTree()
{
FILE *arq = fopen(file, "wb+");
Head *header = (Head *)malloc(sizeof(Head));
header = readHead(arq);
header->pos_root = -1;
header->pos_... |
C | #ifndef LCW_H
#define LCW_H
//
#ifndef stdlib_h
#include <stdlib.h>
#endif
#ifndef stdio_h
#include <stdio.h>
#endif
//----Counts lines, words and chars in the input
//-----------------------------------------------------------------------------
#define YES 1
#define NO 0
//--------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.