language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /**
*包含对控制台的一些基本操作
*/
#ifndef INCLUDE_CONSOLE_H
#define INCLUDE_CONSOLE_H
#include "types.h"
// 定义颜色(可用于前景色或者背景色)
typedef enum real_color
{
rc_black=0,
rc_blue=1,
rc_green=2,
rc_cyan=3,
rc_red=4,
rc_magenta=5,
rc_brown=6,
rc_light_grey=7,
rc_dark_grey=8,
rc_light_blue=9,
rc_light_green=10,
rc_light_cya... |
C | #include <stdio.h>
int main(){
int a = 10;
printf("a - %08X\n~a = %08X\n", a, ~a);
return 0;
} |
C | #include <stdio.h>
int main(){
int i;
char vChar[5];
int vInt[5];
double vDouble[5];
printf("\n endereco de vChar = %ld", (long int)vChar);
for (i = 0; i < 5; i++){
printf("\n endereco de vChar[%d] = %ld", i, (long int)&vChar[i]);
}
printf("\n\n endereco de vInt = %ld", (long int)vInt);
for (i = 0; i < ... |
C | #include "Translator.h"
void translateReg (char* reg, char* out) {
if (!strcmp(reg,"A0")) {
strcpy(out, "00");
}
else if (!strcmp(reg,"A1")) {
strcpy(out, "01");
}
else if (!strcmp(reg,"A2")) {
strcpy(out, "10");
}
else if (!strcmp(reg,"A3")) {
... |
C | #include <stdio.h>
// Compiling C program -> gcc name_of_file.c -o name_of_exe
// ls -al name_of_exe -> see info about the file (size etc)
// int -> return value is a integer
// Void -> no arguments
int main(void) {
printf("Hello World!\n");
} |
C | #include "steepest_descent.h"
#include <string.h>
#define EPSILON 1e-6
/*
* These functions are necessary for the software. They must be
* implemented in a separate file by the user.
*/
void cutest_ufn_ (my_integer *, my_integer * n, my_doublereal * x, my_doublereal * f);
void cutest_uofg_ (my_integer *, my_intege... |
C | /*
* printf_test.c
*
* Created on: 2018-2-20
* Author: virusv
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "smartocd.h"
#include "Library/misc/misc.h"
char* itoa(int num, char *str, int radix) {
/*索引表*/
char index[] = "0123456789ABCDEF";
unsigned unum;/*中间变... |
C | #include <stdio.h>
#include <math.h>
int main() {
double r;
double surface;
double volume;
double perimeter;
printf("%s: ", "Enter radius");
scanf("%lf", &r);
perimeter = 2 * M_PI * r;
surface = 4 * M_PI * (r * r);
volume = (4.0 / 3.0) * M_PI *(r * r * r);
printf("Perimeter:... |
C | /*
* RCS info
* $Author: steves $
* $Locker: $
* $Date: 2009/03/12 17:06:46 $
* $Id: rpg_itc.c,v 1.13 2009/03/12 17:06:46 steves Exp $
* $Revision: 1.13 $
* $State: Exp $
*/
/********************************************************************
This module contains the functions that support
Inter-Task Comm... |
C | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void init(char str[],int length) {
for (int i = 0; i <= length; i++) {
str[i] = 0;
}
}
int main() {
int n = 0;
int cnt = 0;
int i = 0;
int j = 0;
int k = 0;
int start = 0;
int end = 0;
int len = 0;
char str[100] = { 0, };
char* same... |
C | #include <stdio.h>
#include <stdlib.h>
int isreverse(int tab1[], int tab2[], int taille){
if(*tab1 == tab2[taille-1]){
if(taille-1 == 0)
return 1;
return isreverse(tab1+1,tab2,taille-1);
}
return 0;
}
void main(){
int tab1[4]={4,1,2,3};
int tab2[4]={3,1,1,4};
printf("%d\n", isreverse(tab1,ta... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
C | //
// main.c
// hash_function
//
// Created by Raquel Alvarez on 11/18/15.
// Copyright (c) 2015 R. All rights reserved.
//
#include <stdio.h>
#define HASHMAP_RANGE 8192
int hash_function (int disk, int block) {
int temp = disk * 10000;
temp = temp + block;
return (temp%HASHMAP_RANGE);
}
int main(int... |
C | #include <stdio.h>
#include <stdlib.h>
int minimum(int apples,int oranges)
{
if (apples > oranges)
{
return oranges ;
}
else
{
return apples ;
}
}
int maximum (int apples,int oranges)
{
if(apples > oranges)
{
return apples ;
}
else
{
return oranges ;
}
}
int main()
{
i... |
C | #include "ArrayEmployees.h"
static int Employee_incrementalID = 0;
static int Sector_incrementalID = 0;
int employee_getID(void)
{
return Employee_incrementalID += 1;
}
int sector_getID(void)
{
return Sector_incrementalID += 1;
}
int initEmployees(Employee list[], int len)
{
int i;
if(list != NULL && len > 0)
... |
C | #ifndef NODE_H
#define NODE_H
#include "cmm-type.h"
#include "cmm-symtab.h"
typedef struct Node_ *Node;
typedef struct Operand_ *Operand;
struct Node_ {
enum ProductionTag tag;
int lineno;
union {
int i;
float f;
const char *s;
void *p;
const char *operator;
} ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* equalizer_check_file3.c :+: :+: :+: ... |
C | #include "lcd.h"
#include "io_ports.h"
#include "system.h"
#define LCD_CONTROL_SIGNAL(EN,RW,RS) ( (EN*(LCD_EN)) | (RW*(LCD_RW)) | (RS*(~LCD_RS)))
#define LCD_DATA_WRITE_SIGNAL LCD_CONTROL_SIGNAL(1,0,1)
#define LCD_INST_WRITE_SIGNAL LCD_CONTROL_SIGNAL(1,0,0)
#define LCD_CLEAR 0b00000001
#define LCD_HOME ... |
C | /*
* Exercise 7-7.
*
* Modify the pattern finding program of Chapter 5 to take its input from a set
* of named files or, if no files are named as arguments, from the standard
* input. Should the file name be printed when a matching line is found?
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#de... |
C | #include "libft.h"
#include <stdio.h>
int main(void)
{
char *s="lorem \n ipsum \t dolor \n sit \t amet";
printf("en entre ; \n XXX%sXXX\nensortie \nXXX%sXXX\n",s,ft_strtrim(s));
}
|
C | #include <stdio.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>
#include <ctype.h>
//////////////////////////Structs////////////////////////
typedef struct threadBuffer{
char** buffer; // dynamic buffer
pthread_mutex_t lock;
int readpos,... |
C | #include<stdio.h>
main()
{
long int p;
int n;
double q;
printf("----------\n");
printf("2 to power n n 2 to power -n\n");
printf("----------\n");
p = 1;
for(n = 0; n < 21; ++n)
{
if(n==0)
p = 1;
else
p = p*2;
q = 1.0/(double)p;
printf("%10ld%10d%20.1... |
C | #include <git2.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <sys/param.h>
#include <libgen.h>
#include <stdio.h>
/*
* Blogpit is a set of simple functions to access a dictionary
*
*
*... |
C | /*
* CONCURRENCY EXPERIMENT WITH REAL TIME LINUX THREADS (XENOMAI)
*
* ANALYSIS:
The yappy thread ran first.
It is possible to use printf in main. However, printf uses linux syscalls and this
significantly slows down the real-time thread. The rt_printf is preferred because it is
a cheaper printing call (n... |
C | #ifndef LIST_H_
#define LIST_H_
#include "main.h"
typedef UINT8 LSTATUS;
/*------------------------------------------
NULL<-- [Head] <--> [Instance A ] <--> [Instance B] <--> [Tail] -- Null
| |
| ... |
C | #include "fmod/fmod.h"
#include <stdlib.h>
#include <stdio.h>
#include "fonctions.h"
void ADMIN(){
printf("\e[1;1H\e[2J");
printf("---ADMIN CONTROL PANEL---\n");
printf("1) RETOUR\n");
printf("CHOIX : ");
scanf("%d",&choix);
if(choix != 1)
{
printf("Choix impossible. Choisissez une option entre 1 et 1");
}
... |
C | e/*
** EPITECH PROJECT, 2017
** my_put_nbr
** File description:
**
*/
int my_put_nbr(int nb)
{
int n = abs(nb);
int e = abs(nb);
int x = 1000000000;
if (nb == 0)
my_putchar(48);
if (nb < 0)
my_putchar(45);
while (x > abs(nb))
x = x / 10;
while (x != 1 && x != 0) {
n = n / x;
if (n < 10)
m... |
C | //233 "ѹα" о ϴ α ۼϼ.
#include <stdio.h>
void main(void) {
FILE* fp;
char buff[100];
fopen_s(&fp, "file6.txt", "r");
if (fp != NULL) {
while (!feof(fp)) {
fgets(buff, 100, fp);
printf(buff);
}
fclose(fp);
}
}
//feof ̿ нϴ.
// fgets ƹ͵ о ʽϴ. |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct Employee
{
char name[25];
int sapID;
};
struct node
{
void *data;
struct node *next;
};
int integerComp(int *p1,int *p2)
{
if(*p1==*p2)
return 1;
else
return 0;
}
int doubleComp(double *p1,double* p2)
{
if(*p1==*p2)
return 1;
else
return... |
C | #include <stdio.h>
#include "bstree.h"
int main()
{
struct BSTree* t;
printf("testing tree create...");
if ((t = tree_create()) == NULL)
goto fail;
printf("[ok]\n");
int arr[10], count, ref[10] = { 1, 3, 2, 5, 7, 6, 4 };
int i;
printf("testing insert...");
add(t,4);
add(t,2);
add(t,6);
add(t,1);
add(t... |
C | /***************************
* AddData.c
*
*
*
*
***************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "../MAIN/movie.h"
#include "../movieValidate/movieValidate.h"
#include "../codeGen/codeGen.h"
#include "../writeData/writeData.h"
#include "addData.h"
vo... |
C | #include <stdio.h>
extern int yylex(void);
void yyparse();
extern FILE* yyin;
int main(int argc, char **argv) {
if (argc > 1) {
yyin = fopen(argv[1], "r");
if (yyin == NULL){
printf("syntax: %s filename\n", argv[0]);
}//end if
}//end if
yyparse(); // Calls yylex() for tokens.
r... |
C | #include "dna_hasher.h"
uint64_t hashDNAstringtonum(std::string dna)
{
uint64_t result = 0;
for(std::string::iterator it = dna.begin(); it != dna.end(); ++it)
{
result = result << 2;
switch(*it)
{
case 'c':
case 'C':
result |= 1;
break;
case 'g':
case 'G':
result |= 2;
break;
ca... |
C | #include "common.h"
#include "client.h"
#include "map.h"
#include "network.h"
void client_net_block_set(map_t *map, s32 x, s32 y, tile_t tile)
{
printf("client_net_block_set: %d,%d\n", x, y);
if(net_player.sockfd != FD_LOCAL_IMMEDIATE)
{
net_pack(NULL, PKT_BLOCK_SET,
x, y,
tile.type, tile.col, tile.chr);
... |
C | #include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include "log.h"
#include "utils.h"
#include "mem.h"
#include "icy_mem.h"
#include "icy_vector.h"
size_t icy_vector_capacity(icy_vector * table){
return table->area->size / table->element_size - 4;
}
size_t icy_vector_count(icy_vector... |
C | #ifndef __BPT_H__
#define __BPT_H__
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <fcntl.h>
#include <unistd.h>
// page properties
#define PAGE_SIZE 4096
#define OFF(pagenum) ((pagenum) * PAGE_SIZE)
#define INTERNAL_ORDER 249
#define LEAF_ORDER 32
#define... |
C | #include "heap.h"
static void heap_up(heap_t *heap) {
int element_index = heap->length; //Last element in the Heap
while(element_index != 1){
//Get Parent.
int parent_index = (element_index/2);
// Swap if parent is greater
if (heap->store[parent_index-1] > heap->store[element_index-1]){
swap_heap_elem... |
C | #define SYSCALL "mprotect"
#include "common.h"
int run() {
// TODO
return 0;
}
/*
MPROTECT(2) Linux Programmer's Manual MPROTECT(2)
NAME
mprotect - set protection on a region of memory
SYNOPSIS
#include <sys/mman.h>
int mprotect(void *addr, size_t len, int ... |
C | #include<stdio.h>
int main()
{
long long n,i,a[1000],flag,j;
scanf("%lld",&n);
for(i=0;i<n;i++)
scanf("%lld",&a[i]);
for(i=0;i<n;i++)
{
flag=0;
for(j=0;j<n;j++)
{
if(i!=j&&a[i]==a[j])
{
flag=1;
break;
}
}
if(flag==0)
{
printf("%lld",a[i]);
break;
}
}
}
|
C | /*!
* @file queue.h
* @author Tyler Holmes
*
* @date 20-May-2017
* @brief Simple circular buffer handler.
*/
#pragma once
#include <stdint.h>
//! The structure to track all pertinant variables for the circular buffer.
typedef struct {
volatile uint8_t head_ind; //!< Tracks the front of the buff... |
C | /**
@file schedule.h
@brief Definitions, data structues and prototypes for generic scheduling mechanisms
@author Joe Brown
*/
#ifndef SCHEDULE_H
#define SCHEDULE_H
/** @brief timing multiplier to allow regular interval scheduling with varying
clock speeds */
extern volatile uint8_t g_timing_multiplier;
... |
C | #include<stdio.h>
#include<time.h>
int a[1000],b[1000],c[1000],A[1000],ac[1000];
int n,m,i,j,ch,m,temp,num;
FILE *f;
double t;
clock_t t1,t2;
void display()
{
printf("\n\nBubble Sort:");
for(int k=0;k<n;k++)
printf(" %d ",a[k]);
printf("\n");
printf("\nInsertion Sort:");
for(int k=0;k<n;k++)
print... |
C |
//#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <time.h>
//#include "pthreadbarrier.h"
#define num_thrds 4
pthread_barrier_t mybarrier;
void* threadFn(void *id_ptr) {
long thread_id = (long) id_ptr;
int wait_sec = 1 + rand() % 4;
printf("thread %... |
C | /* SPDX-License-Identifier: BSD-2-Clause */
/*
* Copyright (c) 2017, Intel Corporation
* All rights reserved.
*/
#include <glib.h>
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include <cmocka.h>
#include "tpm2-header.h"
#include "tpm2-response.h"
#include "util.h"
#define HANDLE_TEST 0xdeadbeef
#de... |
C | /*
* Programmer: Hermes Obiang
* CptS 360 - Fall 2019
* Project Level 1
*/
/************* level 1 file **************/
/**** globals defined in main.c file ****/
extern MINODE minode[NMINODE];
extern MINODE *root;
extern PROC proc[NPROC], *running;
extern char gpath[256];
extern char *name[64];
extern int n;
... |
C | #include "mb_log.h"
#include "packet.h"
#include <arpa/inet.h>
#include <linux/if_ether.h>
#include <linux/tcp.h>
#include <linux/ip.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
int process_packet(struct pair_entry *p, struct iphdr *iph, int ipl, struct tcphdr *tcph, int tl, uint8_t *reply, int *len)
{... |
C | #include <stdio.h>
int main(){
int x,y;
scanf("%d%d", &x, &y);
int month[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int totalDays = 0;
for(int i = 1; i < x; i++){
totalDays += month[i-1];
}
totalDays += y;
totalDays = totalDays % 7;
switch(totalDays){
case 1:... |
C | #include<stdio.h>
int add(int,int);
int sub(int,int);
int main(int argc,char const *argv[])
{
printf("Addition:%d\n",add(10,20));
printf("Difference:%d\n",sub(10,20));
return 0;
} |
C | #include <stdio.h>
int main(){
char s1[] = "Now is the time for all good programmers";
int i;
printf("s1 is : %s\n", s1);
printf("Printing one char at a time: ");
for (i=0; s1[i] != '\0'; i++ ) {
printf("%c ", s1[i]);
}
printf("\n");
char s2[100];
printf("Enter a string: ");
scanf("%100[^\n]... |
C | /*
* motorControl.c
*
* Control module for the main and tail motors of the helicopter.
*
* Author: J. Shaw and M. Rattner
*/
#include "globals.h"
#include "motorControl.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/sysctl.h"
#include "driverlib/pwm.h"
#include "driverlib/gpio.h"
... |
C | #include <linux/input.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include "libfahw.h"
#define IR_PATH "/dev/input/event2"
#define IR_EVENT_TIMES (20)
void IRHandler(int signNum)
{
if (signNum == SIGINT)... |
C | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
double X, Y, res;
int N, i;
scanf("%d",&N);
for(i=1; i<=N; i=i+1)
{
scanf("%lf %lf",&X,&Y);
if(Y!=0)
{
res=X/Y;
printf("%0.1lf\n",res);
}
else
{
printf("disisao impossivel\n");
}
}
... |
C | #include<conio.h>
void main()
{
int bt[20],p[20],ct[20],at[20]={0},tat[20],wt[20],temp,n,i,j;
float avgwt=0,avgtat=0;
clrscr();
printf("Enter no of processes: ");
scanf("%d",&n);
printf("Enter burst time of procceses: ");
bt[0]=0;
p[0]=0;
for(i=1;i<=n;i++)
{
scanf("%d",&bt[i]);
p[i]=i;
}... |
C | /*
CELLULAR AUTOMATON IN C - automata.c
AC21009 COURSEWORK 2, TEAM 21
AUTHORS: Daniel Kevin Blackley (160007728)
Esther Bolik (170010779)
Michael Wamarema (150024823)
LAST MODIFIED: 2018-11-08
*/
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <strin... |
C | /**
* Name : log.c
* Author : Jrgen Ryther Hoem
* Lab : Lab 4 (ET014G)
* Description : Log functions, uses FAT service and SD/MMC driver
*/
#include <asf.h>
#include <string.h>
#include "log.h"
/***** VARIABLES ****************************************************/
// Set... |
C | #include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
#include "QBDI.h"
int fibonacci(int n) {
if(n <= 2)
return 1;
return fibonacci(n-1) + fibonacci(n-2);
}
VMAction showInstruction(VMInstanceRef vm, GPRState *gprState, FPRState *fprState, void *data) {
// Obtain an an... |
C | #include "myarraylib.h"
#include <stdio.h>
#include <stdlib.h>
#include "time.h"
float *creatVector(int n) {
float *v = (float *) malloc(n * sizeof (float));
return v;
}
void fillArray(float *v, int n) {
int i;
srand(time(0));
for (i = 0; i < n; i++) {
v[i] = (rand() % 10) + 1;
}
}
... |
C | Purpose: This program displays a menu
to the user containing information
about a politician. If the menu item is
unknown, the user is allowed to enter
that information.
Assumptions: It is assumed that the user
knows what they can and cannot input from
the given directions provides. The program
accepts characted and in... |
C | /*
печать таблицы температур по Фаренгейту
и Цельсию для fahr = 0, 20, ..., 300
Ref:
C Kerigan Richi 2001.pdf
1.2. Переменные и арифметические выражения
*/
#include <stdio.h>
main()
{
int fahr, celsius;
int lower, upper, step;
lower = 0; /* нижняя граница таблицы температур */
upper = 300; /* верхняя... |
C | /*MIT License
Copyright (c) 2021 Michał Bazan
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY C... |
C | //SPDX-License-Identifier: LGPL-2.0-or-later
/*
Copyright (c) 2014-2020 Cyril Hrubis <metan@ucw.cz>
*/
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <dirent.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/inotify.h>
#... |
C | /*
* mfile.c
*
* This file is part of zeroskip.
*
* zeroskip is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*
*/
#define _XOPEN_SOURCE 500 /* For ftruncate() see `man ftruncate` */
#include <errno.h>
#include <fcntl.h>
#include <... |
C | #include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include "unittest.h"
#include "bs_tree_map.h"
int tree_str_traverse_count = 0;
void bs_tree_map_str_free_cb(void *key, void *value)
{
if (key) {
// nothing to free here
}
if (value) {
// nothing to free here
... |
C | // Shared via Compiler App https://g633x.app.goo.gl/TPlw
#include<stdio.h>
void main()
{
int i,j;
printf("i j i&j");
for(i=0;i<=1;i++)
{
for(j=0;j<=1;j++)
{
printf("\n%d %d %d",i,j,i&&j);
}
}
}
|
C | #include <stdio.h>
int main()
{
int broj, temp, pom = 1;
scanf("%d", &broj);
temp = broj;
while(temp) {
temp /= 10;
pom *= 10;
}
while(pom > 1) {
pom /= 10;
printf("%d ", broj / pom);
broj %= pom;
}
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct _node{
int key;
struct _node *left;
struct _node *right;
} Node;
typedef Node* Tree;
void print_t(Tree t){
if(t != NULL){
print_t(t->left);
printf("%d\n", t->key);
print_t(t->right);
}
}
int get_... |
C | #include <stddef.h>
#include <ctype.h>
#include<stdio.h>
getwords(char *line, char *words[], int maxwords)
{
char *p = line;
int nwords = 0;
while(1)
{
while(isspace(*p))
p++;
if(*p == '\0')
return nwords;
words[nwords++] = p;
while(!isspace(*p) && *p != '\0')
p++;
if(*p == '\0')
return nwords;
*p+... |
C | #include<stdio.h>
int isprime( long num ){
long i=2;
while( i<num ){
if( num%i++==0 ) return 0;
}
return 1;
}
int main(){
printf( "%d\n", isprime(715827883) );
}
|
C | //逗号运算符
#include <stdio.h>
int main()
{
int a=1;int b=2;int c=3;
a++,b++,c++;//逗号表达式
a=(a+1,b+1,c+1);//赋值表达式,输出最大的数。
printf("a=%d,b=%d,c=%d",a,b,c);
return 0;
}
|
C | /**
* @file calorie.h
*
* @brief Libreria per la gestione delle calorie.
*
* La libreria calorie.h stata implementata per permettere all'utente
* la gestione delle proprie assunzioni con il corrispettivo valore
* calorico.
*
* @authors Alessandro Scarcia, Davide Quatela, Michela Salvemini
*/
#if... |
C | #include<stdio.h>
/* ִ빦ܽ飺ԭ */
/* User Code Begin(Limit: lines<=1, lineLen<=50, ڱкӴ롢1Сÿг<=50ַ) */
int deal(char *str);
/* User Code End(Ӵע⣺к͵Ϊһе{}гtab) */
int main(void)
{
int Len;
char String[101];/* = "?????????????????????????????????????????????????????????????"; */
printf("\ninput a string: ");
/* ִ... |
C | #include <stdio.h>
#include <stdlib.h>
#include "NHAL_function.h"
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
typedef struct{
int msgN;
int cfg;
void *next;
}Search_msg;
typedef enum{
Idle,
RF_on,
Srch_on,
RF_sync
}Scheduler_state;
typedef enum{
norm... |
C | #include <stdlib.h>
#include "oeving2.h"
#include "sys/interrupts.h"
//Since this is the file utilizing the extern type-modified pointers below, we initialize them here with the values given in the code supplied to us.
volatile avr32_pio_t *piob = &AVR32_PIOB;
volatile avr32_pio_t *pioc = &AVR32_PIOC;
volatile avr32_p... |
C | #include "img_pro.h"
unsigned char **alloc_img(int ncol,int nrow)
{
int i;
unsigned char **img;
/* allocate pointers to rows */
img = (unsigned char **) malloc((size_t)((nrow+1)*sizeof(unsigned char*)));
if (!img)
{
printf("\n\n Cannot allocate memory (1)\n");
exit(0);
}
/* allocate rows and set p... |
C | #include <stdio.h>
int main (void)
{
char theCharA = 'A';
char theCharZ = 'Z';
printf("the first char is:%c \n",theCharA);
printf("the second char is:%c\n" ,theCharZ);
printf("the num of chars without A and Z :%d\n", (theCharZ-theCharA-1));
getchar();
} |
C | /*******************************************************************************************
** Name: Peter Moldenhauer
** Date: 12/30/16
** Description: This program demonstrates puts and gets - easier than printf() and scanf().
** Puts() prints a string out to the screen and gets() gets a string from the user. In bot... |
C | #ifndef SORT_H
#define SORT_H
#include <stdio.h>
#include <stdlib.h>
/* DATA STRUCTURES */
/**
* struct listint_s - Doubly linked list node
*
* @n: Integer stored in the node
* @prev: Pointer to the previous element of the list
* @next: Pointer to the next element of the list
*/
typedef struct listint_s
{
cons... |
C | struct stack_record
{
int size;
int top;
int min;
int min_loc;
int *array;
};
typedef struct stack_record *STACK;
#define EMPTY (-1)
#define MIN_STACK_SIZE 4
#define BUFSIZE 10
#define MAX 99999
STACK create_stack(int max_elements)
{
STACK S;
if(max_elements<MIN_STACK_SIZE)
printf("Stack size is too... |
C | #include<unistd.h>
#include<sys/types.h>
#include<stdio.h>
#include<fcntl.h>
void main(){
int fd = creat("text1.txt", O_RDWR);
char buf[80]="Hello World \nThis is line 1\nLine 2";
int bytes = write(fd, buf, sizeof(buf));
printf("Number of bytes written: %d\n",bytes);
} |
C | //Estructuras de Funciones
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct NODO{
char usuario [21];
char barrio [41];
int tel;
char mail[41];
char password [11];
struct NODO *next;
};
struct LIBRO{
char titulo[41];
struct LIBRO *next;
};
void alta_usuario();
void baja_usuario();
// ... |
C | /// \file constantes.h
/// \brief Implementation file for "CG-N2_HelloWorld".
/// \version $Revision: 1.0 $
/// \author Dalton Reis.
/// \date 05/09/13.
#ifndef CG_N2_HelloWorld_constantes_h
#define CG_N2_HelloWorld_constantes_h
inline void SRU(void) {
// eixo X - Red
glColor3f(1.0f, 0.0f, 0.0f);
glB... |
C |
#define TEST_NAME "box_seal"
#include "cmptest.h"
int
main(void)
{
unsigned char pk[crypto_box_PUBLICKEYBYTES];
unsigned char sk[crypto_box_SECRETKEYBYTES];
unsigned char *c;
unsigned char *m;
unsigned char *m2;
size_t m_len;
size_t c_len;
crypto_box_keypair(pk, sk);... |
C | /*
* This implementation replicates the implicit list implementation
* provided in the textbook
* "Computer Systems - A Programmer's Perspective"
* Blocks are never coalesced or reused.
* Realloc is implemented directly using mm_malloc and mm_free.
*
* NOTE TO STUDENTS: Replace this header comment with your own ... |
C | #include "libmx.h"
t_list *mx_sort_list(t_list *lst, bool (*cmp)(void *, void *)) {
t_list *new = NULL;
while(lst != NULL) {
t_list *node = lst;
lst = lst->next;
if (new == NULL || cmp(node->data, new->data) == 0)
{
node->next = new;
new = node;
}
else {
t_list *current = new;
while(current... |
C | #include <stdio.h>
#include <stdlib.h>
#define P_COUNT 7
#define R_COUNT 3
#define RED "\033[31m"
#define GREEN "\033[32m"
#define RESET "\033[0m"
int main(){
int current[P_COUNT][R_COUNT] = {
{1,2,3},
{2,0,4},
{1,1,1},
{3,4,1},
{2,3,2},
{5,2,1},
{2,1,1}
};
int max[P_COUNT][R_COUNT] = {
... |
C | #define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
int i = 0;
int num = 0;
int a = 0;
for (i = 100; i <= 200; i++)
{
for (num = 2, a = 0; num <= (i - 1); num++)
{
if (i % num == 0)
a++;
}
if (a == 0)
printf("%d ", i);
}
return 0;
} |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "network.h"
#include "error.h"
// Author: Gordon Gao
// Implements the client of the application layer
int main(int argc, char* argv[])
{
struct timeval start, end;
// File pointer and strings to concatenate to ... |
C |
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
int main()
{
int i, sum = 0;
int n=0;
//allocate space for how many words you want
printf("how many words you want: ");
int words;
n=scanf( "%i", &words );
char *letter[words];
char tep[256]; //placeholder for the words ... |
C | #include <stdlib.h>
#include <stdio.h>
static int controlling = 1;
int esAcotadoI(int num, int minimo){
return(num>=minimo);
}
int esAcotadoM(int num, int maximo){
return(num<=maximo);
}
int esAcotado(int num, int minimo, int maximo){
return(esAcotadoI(num, minimo) && esAcotadoM(num, maximo));
}
int dEsAcota... |
C | #include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#define NUMBER '0'
#define BUFSIZE 100
#define MAXVAL 100
int sp = 0;
double val[MAXVAL];
int getop(char *);
void push(double);
double pop(void);
main(int argc,char *argv[]){
int i,type;
double op2;
for(i=0;i<argc-1&&(type=getop(*++argv))!='\0';i++){
swi... |
C | /*
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
gcc main.c -o server -lSDL2 -lSDL2_net
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_net.h>
//-----------------------------------------------------------------------------
#define ... |
C | /*
* File: main.c
* Author: George Main IV
*
* Created on August 1, 2017, 7:56 PM
*/
#include "configurationBits.h"
#include "main.h"
#include "device.h"
#include "uart.h"
#include <xc.h>
#include <stdio.h>
#include <libpic30.h>
#include <p33ev256gm102.h>
int main(void) {
// Initialize oscillator
... |
C |
#pragma once
/************************************************************************/
//----------------------------------------------------------------------//
/**
* @LCDɕ\B
*
* _adrs : \ꏊ
* _char : \镶
*/
inline void LCD_Write_char (const LcdAdrs _adrs, const char _char)
{
PUT_LCD(_adrs, _char);
}
//---... |
C | // cc -std=c99 -D_BSD_SOURCE -Os closure-demo.c -lm
#if (!defined(__unix__) && !defined(__APPLE__)) || !defined(__x86_64__)
# error Requires x86_64 and System V ABI
#endif
/* Closure functions. */
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
static void
closure_set_data(void *closure, void *data)
{... |
C | #include <config.h>
#include <file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
int MapFile(PT_FileMap ptFileMap)
{
int iFd;
FILE *tFp;
struct stat tStat;
tFp = fopen(ptF... |
C | #include <stdio.h>
#include <assert.h>
/***strspn()函数检索区分大小写***/
int my_strspn(const char *str1, const char *str2)
{
/***从参数str1字符串的开头计算连续的字符,而这些字符都完全是str2所指字符串中的字符。
简单的说,若strspn()返回的数值为n,则代表字符串str1开头连续有n个字符都是属于字符串str2内的字符***/
assert(str1 != NULL && str2 != NULL);
const char *tmp = str1;
const char *str3;
while... |
C | /*
* funcionesConsola.c
*
* Created on: 26/5/2016
* Author: utnso
*/
#include <stdio.h>
#include <stdlib.h>
#include <commons/log.h>
#include <commons/collections/list.h>
#include <commons/config.h>
#include "consola.h"
#include <string.h>
void empaquetarYenviarArchivo(t_archivo* archivo){
c... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* calc_effective_letter.c :+: :+: :+: ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_utoa2.c :+: :+: :+: ... |
C | #include "test_match_item.h"
#include <check.h>
#include <stdlib.h>
#include "test_test_helpers.h"
#include "../src/core/match_item.h"
START_TEST (test_get_n_items)
{
MatchItem f1;
MatchItem f2;
MatchItem f3;
MatchItem f4;
f1.next = &f2;
f1.index = 0;
f2.next = &f3;
f2.index = 1;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.