text
stringlengths
9
5.83M
/* * Copyright (C) 2017 spreadtrum.com */ #include <stdbool.h> #include <stdlib.h> #include <string.h> #include <err.h> #include <trusty_std.h> #include <stdio.h> #include <lib/sprdimgversion/sprdimgversion.h> #define LOG_TAG "libsprdimgversion" #define TLOGE(fmt, ...) \ fprintf(stderr, "%s: %d: " fmt, LOG_T...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "commo_header.h" #include "parse_utili.h" // // -1:error 0x00:normal 0x01:constructor int check_space_type(char *clasn, char *metnm, char *decla, char *space) { char *toksp = kill_blank(space); if (!toksp) return -1; char *tokep = strch...
#include<stdio.h> #include<sys/types.h> #include<sys/socket.h> #include<errno.h> #include<netinet/in.h> #include<string.h> #include<sys/wait.h> #include<arpa/inet.h> #include<stdlib.h> #include<unistd.h> void sendstring(int sd,char *string); int main(int argc,char *argv[]) { int sd,fd; int con_ret; struct sockaddr_in...
/* * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * * Copyright (c) 2019-2020 Damien P. George * * 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...
#ifndef INDIVIDUO_H #define INDIVIDUO_H void inserirIndividuo(); int buscarIndividuo(char *id); void removerIndividuo(); #endif
/** * 5. Crie um programa que defina e imprima a seguinte matriz: * * { * { 'I', 'F', 'S', 'P' }, * { '2', '0', '1', '6' } * } */ #include<stdio.h> int main() { int i, j; char matriz[2][4] = { { 'I', 'F', 'S', 'P' }, { '2', '0', '1', '6' } }; for(i = 0; i < 2; i++) ...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <omp.h> #include <complex.h> #define spIndType long long #define spValType float complex void applyHybridKaczmarz(spIndType *rowptr , spValType *valA ,spIndType *colA, long long numDomains, long long domainLength , unsigned int *ArrIdxs, spVa...
#include <stdio.h> int main() { float num1, num2, result; char op; printf("Enter your operation\n"); scanf("%f %c %f", &num1, &op, &num2); switch (op) { case '-': result = num1 - num2; printf("Result: %.2f", result); break; case '+': re...
#include <stdio.h> void welcome(void) { printf("---=== Grocery Inventory System ===---\n\n"); } void prnTitle(void) { printf("Row |SKU| Name | Price |Taxed| Qty | Min | Total |Atn\n"); printf("----+---+--------------------+--------+-----+-----+-----+------------|---\n"); } void prnFooter(doubl...
#include "min_unit.h" #include "common.h" #include "tests_common.h" #include <stdlib.h> #include <stdio.h> #ifdef _WIN32 #include <process.h> #endif char* test_cell_type_is_player_owned() { mu_assert(!cell_type_is_player_owned(GROUND)); mu_assert(!cell_type_is_player_owned(WATER)); mu_assert(!cell_type_is_player...
/* * TestLCD.c * * Created: 11/14/2014 12:07:54 PM * Author: saida */ /* * LCD_Atmel1.c * * Created: 10/24/2014 3:29:51 PM * Author: LuisDavid * still a alpha Version 0.2 */ // CARLOS: // FROM LCD_Atmel.h you there is a line you can modify at will // to change how the cursor looks like #define F_CPU...
#include <stdio.h> typedef struct _var { int v, n; } var; // функция подсчёта повторений var* cnt_moda(const int* f, const int* l, var* v) { var* p, * n; for (n = v; f != l; ++f) { for (p = v; (p != n) && (p->v != *f); ++p); p->v = *f; p->n++; if (p >= n) ++n; } return v + (n - v); } // функция воз...
#include <std.h> #include <marsh.h> inherit MONSTER; void create() { ::create(); set_gender("female"); set_name("fish"); set_id( ({ "rainbow","rainbow trout","fish"}) ); set_short("A rainbow trout"); set_long("The colors of the rainbow are brightly displayed on the side of this fish."); set_level(...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <errno.h> #include <signal.h> #include <fcntl.h> #include <ctype.h> #include <termios.h> #include <sys/types.h> #include <sys/mman.h> #include "ocelot.h" #define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", ...
/*--------------------------------------------------------------------------*/ /* */ /* comp2.c */ /* 23/04/2021 ...
#include <stdio.h> #include <pthread.h> #include <stdlib.h> pthread_key_t var; void destructor(void * p) { free(p); pthread_setspecific(var, NULL); } void * Hilo1(void * id) { char * valor = (char *) pthread_getspecific(var); if(valor == NULL) { valor = (char *)malloc(10*sizeof(char)); ...
#include "OPF.h" #include <emscripten.h> EMSCRIPTEN_KEEPALIVE void c_opf_classify(int *argc, char **argv) { EM_ASM( FS.syncfs(true, function (err) { // Error }); ); errorOccurred = 0; opf_PrecomputedDistance = 0; if ((*argc != 4) && (*argc != 3)) { fprintf(stderr, "\nusage op...
#ifndef lint static char *sccsid = "@(#)siglist.c 1.3 (ULTRIX) 1/29/87"; #endif lint /************************************************************************ * * * Copyright (c) 1985 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is...
/* * File: invo_bzl.h * Author: James Xu * * Created on 2016.12.17, PM 2:16 */ #ifndef INVO_BZL_H #define INVO_BZL_H #include "commo_header.h" #include "conve.h" #include "clas_save.h" #ifdef __cplusplus extern "C" { #endif // int compbzl_create(char *data_directory); // int compbzl_destroy(); ...
#include<stdio.h> void printArray(int a[],int size){ for (int i = 0; i < size; i++) { printf("%d ",a[i]); } } int partision(int A[], int low,int high){ int pivot = A[low]; int i = low+1; int j = high; int temp; do { while (A[i]<=pivot) { i+...
#include "geom.h" #include <assert.h> #include <stdio.h> #include <stdlib.h> /* **************************************** */ /* returns the signed area of triangle abc. The area is positive if c is to the left of ab, and negative if c is to the right of ab */ int signed_area2D(point2D a, point2D b, point2D c) { ...
#ifndef ZNPCSPAWNER_H #define ZNPCSPAWNER_H #endif
/* * BeanSim : Nand Flash Simulator by File Operations * Authors: Bean.Li<lishizelibin@163.com> * * This file is part of BeanSim. * * BeanSim is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either vers...
/* ** EPITECH PROJECT, 2017 ** key_pressed ** File description: ** Desc */ #include "fight.h" void key_down(t_fight *fight, t_select *select) { if (sfKeyboard_isKeyPressed(sfKeyDown) == sfTrue && select[0].i == 0) select_bottom(fight, select); else if (sfKeyboard_isKeyPressed(sfKeyDown) == sfTrue && select[0]...
/* * rc.h * * Created on: 05.04.2016 * Author: Arndt */ #ifndef RC_H_ #define RC_H_ #include <Arduino.h> #include <FreeRTOS.h> #include <FreeRTOSConfig.h> #include <task.h> #include <RCSwitch.h> #include <FiFo.h> #include "defines.h" enum rc_type { A=0, B=1, C=2, D=3 }; struct RcQueueTxCommand { in...
/* Copyright (c) 2013 The F9 Microkernel Project. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include <os/platform/debug_device.h> #include <errno.h> #include <os/types.h> #ifdef CONFIG_DEBUG_DEV_UART //#include <os/debug_uart.h> #...
/* FuseCompress Copyright (C) 2005 Milan Svoboda <milan.svoboda@centrum.cz> (C) 2011 Ulrich Hecht <uli@suse.de> */ #include "structs.h" extern int min_filesize_background; extern int root_fs; extern int read_only; extern int cache_decompressed_data; extern int decomp_cache_size; extern int max_decomp_cac...
#include <keyboard.h> #include <print.h> #include <8259A.h> #include <int.h> #include <x86.h> extern unsigned char scancode_types[]; extern char scancode_ascii[]; extern char scancode_shift_ascii[]; void key_putc(char); static struct key_desc keys; void keyboard_interrupt(struct regs *reg) { /* * We must read thi...
#include <stdio.h> #include <stdlib.h> #include "linkedlist.h" void addFirst(int d){ Node * newNode = } void printList(){ if (head==NULL) printf("Emptylist\n"); else }
#ifndef FUNCIONES_H_INCLUDED #define FUNCIONES_H_INCLUDED #endif // FUNCIONES_H_INCLUDED float numeroA(); /** \brief numeroA obtiene un numero para 1er operando ingresado por el usuario. * * \param num guarda el numero ingresado. * \return num devuelve el valor ingresado. * */ float numeroB(); ...
/* * 1wire_bus.h * * Created on: 2020年11月30日 * Author: tom */ #ifndef ONE_WIRE_BUS_H_ #define ONE_WIRE_BUS_H_ #include "gpio.h" #define ONE_WIRE_SEARCH_ROM 0xF0 #define ONE_WIRE_READ_ROM 0x33 #define ONE_WIRE_MATCH_ROM 0x55 #define ONE_WIRE_SKIP_ROM 0xCC #define ONE_WIRE_ALARM_SEARCH 0xEC #de...
void fit_mjj_Full_PFNo3Dijet2017bgCSVv2le1b800() { //=========Macro generated from canvas: c/c //========= (Thu Sep 20 01:51:07 2018) by ROOT version6.02/05 TCanvas *c = new TCanvas("c", "c",0,0,600,700); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c->SetHighLightColor(2); c->Range(0,0,1,1); c->Se...
/** test1i.c --- Init module for test 1. Christopher League Test 1 just loads a module, starts it, and closes it. Both modules say hello, and that's about it. It also tests Get_char, Kmalloc, and Kfree system calls. **/ #include "io412.h" #include "klib.h" /** Local prototypes, etc. */ typedef in...
#include <apue.h> Sigfunc * signal_intr (int signo, Sigfunc *func) { struct sigaction act, oact; act.sa_handler = func; sigemptyset (&act.sa_mask); act.sa_flags = 0; #ifdef SA_INTERRUPT act.sa_flags |= SA_INTERRUPT; #endif if (sigaction (signo, &act, &oact) < 0) return (SIG_ERR); return (oact.sa_handler); }
#include <swamp.h> #include <std.h> inherit MONSTER; int wraithgo(); void create() { ::create(); set_name("bog wraith"); set_short("bog wraith"); set_long("Shadowy creatures that haunt the swamp, bog wraiths stand nearly seven feet tall and wear rotting black robes. They have blood red eyes which are the only disting...
#include <std.h> #include <saahr.h> inherit HOUSE_ROOM; void create() { ::create(); set_properties(([ "light":2, "night light":1, "indoors":0, "town":1 ])); set_short("a small town"); set_long( "The river flows nearby beneath a tall willow tree. A small cottage " "sits in a bed of f...
#include <sys/types.h> /* See NOTES */ #include <sys/socket.h> #include <unistd.h> #include <stdio.h> #include <errno.h> #include <netinet/in.h> #include <arpa/inet.h> #include <signal.h> #include <netdb.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <ctype.h> #...
/* * File: ScreenMasterCommandList.h * Author: fascio * * Created on December 17th, 2014, 19:03 */ #ifndef __SCREEN_MASTER_COMMAND_LIST_H__ #define __SCREEN_MASTER_COMMAND_LIST_H__ #include "ScreenDisplayDeviceCommandList.h" //**********************************************************************************...
/* * buffer_functions.c * * Created on: 11-Nov-2019 * Author: Hp */ #include <buffer_functions.h> #include <stdint.h> #include <stdlib.h> #include <stdbool.h> #include <fsl_debug_console.h> uint8_t rw; enum Error_status result; /* Function to create buffer */ // Pass a storage buffer and size enum Error_st...
//FASE DI DISCESA PARACADUTALE E ATTERRAGGIO #pragma once #ifndef DISCESA_BASSA_H #define DISCESA_BASSA_H #include "Utilita_Librerie.h" extern STR_Sistema Sistema; extern STR_Telemetria Telemetria; extern STR_Sensori Sensori; void do_DiscesaBassa(); #endif
/* **************************************************************** * * * mkdir.c * * * * Gerenciador de arquivos * * * * Versão 4.5.0, de 17.10.03 * * 4.5.0, de 17.10.03 * * * * Módulo: xfm * * Utilitários Básicos * * Categoria B * * * * T...
00010000020004d7 */ /* inherited classes #ifndef _OZ00010000020004d1P_H_ #define _OZ00010000020004d1P_H_ #define OZClassPart0001000002fffffd_0_in_00010000020004d1 1 #define OZClassPart0001000002fffffe_0_in_00010000020004d1 1 #define OZClassPart00010000020004d6_0_in_00010000020004d1 -1 #define OZClassPart000100000200...
/** greedy ayadi mohammed ayadi.mohamed@outlook.com **/ #include <stdio.h> #include <cs50.h> #include <math.h> #define QUARTER 25 #define DIME 10 #define NICKEL 5 #define PENNY 1 //prototypes float getUserAmount(void); int main(void) { float amount = getUserAmount(); int cents = round(amoun...
#ifndef _SAMPLE_FUNCTIONS #define _SAMPLE_FUNCTIONS void looping_func(void); long int returning_func(void); #endif
#include<stdio.h> #include<conio.h> struct process { char name; int at,bt,ct,wt,tt; int completed; float ntt; }p[10]; int n; void sortByArrival() { struct process temp; int i,j; for(i=0;i<n-1;i++) { for(j=i+1;j<n;j++) { if(p[i].at>p[j].at) { temp=p[i]; p[i]=p[j]; p[j]...
/* Generated by re2c 1.1.1 */ /* scanner.re * * This file is part of the Phalcon Framework. * * (c) Phalcon Team <team@phalcon.io> * * For the full copyright and license information, please view the * LICENSE.txt file that was distributed with this source code. */ #include "php_phalcon.h" #include "scanner.h" ...
/* * helper.h * * Created on: Dec 31, 2018 * Author: jan * * helper.h consists of helper functions for Internet applications */ #ifndef SRC_HELPER_H_ #define SRC_HELPER_H_ // includes #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <netdb.h> #include <string.h> #include <stdi...
/* SPDX-License-Identifier: BSD-2-Clause */ /***********************************************************************; * Copyright (c) 2015 - 2017, Intel Corporation * All rights reserved. ***********************************************************************/ #ifdef HAVE_CONFIG_H #include <config.h> #endif #inclu...
/*********************************************************************** * COSC1076 - Advanced Programming Techniques * Summer 2015 Assignment #2 * Full Name : Joshua Richards * Student Number : s3490925 * Course Code : COSC 1076 * Program Code : BP 162 * Start up code provided by David Shaw *...
#include <stdio.h> #include <sys/mman.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <errno.h> #include <linux/fb.h> #include <string.h> #define BLUETOOTH_DEV "/dev/ttyUSB0" #define BAUDRATE 9600 int main(...
#ifndef _BLUTOOTH_H #define _BLUTOOTH_H #include "main.h" #define BLUTOOTH_USART UART4 #define BLUTOOTH_USART_CLK RCC_APB1Periph_UART4 #define BLUTOOTH_USART_IRQ UART4_IRQn #define BLUTOOTH_PORT_CLK RCC_AHB1Periph_GPIOC #define BLUTOOTH_TX_PORT GPIOC #define BLUTOOTH_TX_PIN GPIO_Pin_10 #define B...
// /adm/simul_efun/effective_light. // from the Nightmare mudlib // returns the total effective light available to a player // taking into effect her sight_bonus and any personal // object she may be carrying that modify her own personal light // Idea by Descartes, coded by Valodin 1-19-93 // recoded by Nu...
#include <stdio.h> unsigned int le_to_be(unsigned int value); int main(int argc, char **argv) { unsigned int data = 0xAABBCCDD; printf("the value is %X \n", data); le_to_be(data); return 0; } unsigned int le_to_be(unsigned int value) { unsigned int be = 0x00; unsigned char *tmp; tmp = &value; ...
int scan_int(){ int number; number = 0; scanf("%d",&number); return number; } double scan_double(){ double number; number = 0.0f; scanf("%lf",&number); return number; } float scan_float(){ float number; number = 0.0f; scanf("%f",&number); return number; } char scan_cha...
#include <sys/types.h> #include <sys/socket.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <netdb.h> #include <unistd.h> #include <stdbool.h> #include <netinet/in.h> #include <arpa/inet.h> #include <pthread.h> #include <stdint.h> #include <pthread.h> int socket_recv(int clientSocket, void** buf...
/* ----------------------------------------------------------------------------- Filename: v_cfg.h Description: Toolversion: 02.01.13.01.10.01.32.00.00.00 Serial Number: CBD1100132 Customer Info: BEIQI Foton Motor Co., Ltd. Foton ...
#include "easy_usart.h" void easy_uart_setup(uint32_t baudrate, uint32_t cpu_frequency) { uint32_t ubbr = caculate_ubbr(baudrate, cpu_frequency); set_ubbr(ubbr); set_send_character_size(DATA_8BIT); UCSR0B = (RXEN | TXEN); stdin = stdout = (FILE *)&full_stdio; } uint32_t caculate_ubbr(uint32_t baudrate, u...
/********************************************************************************************************* ** ** 中国软件开源组织 ** ** 嵌入式实时操作系统 ** ** SylixOS(TM) LW : long wing ** ** Copyright Al...
#include <stdio.h> int my_strcmp(const char *s1, const char *s2) { int i = 0; fprintf(stdout, "s1 : %s\n", s1); fprintf(stdout, "s2 : %s\n", s2); while (*s1 == *s2++) { fprintf(stdout, "count : %d\n", i); fprintf(stdout, "s1 : %c\n", *s1); fprintf(stdout, "s2 : %c\n", *s2); if (*s1++ == '\0') { ...
#include <stdio.h> #define bool int #define false 0 #define true 1 int isPowerOfThree(int n) { if(n == 1) return true; else if(n == 0) return false; else if(n % 3 == 0) return isPowerOfThree(n / 3); else return false; } int main(int argc,const int **argv[]) { int nums; scanf("%d",&nums); printf("\n ...
#ifndef lint static char *sccsid = "@(#)sg.c 1.8 ULTRIX 3/3/87"; #endif lint /************************************************************************ * * * Copyright (c) 1985, 86 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furn...
0001000002000337 00010000020007a4 */ /* inherited classes #ifndef _OZ0001000002000254P_H_ #define _OZ0001000002000254P_H_ #define OZClassPart0001000002fffffd_0_in_0001000002000254 1 #define OZClassPart0001000002fffffe_0_in_0001000002000254 1 #define OZClassPart0001000002000336_0_in_0001000002000254 -2 #define OZClas...
void fit_mjj_Full_Dijet2017ScanbbCSV2b152() { //=========Macro generated from canvas: c/c //========= (Thu Jul 26 13:11:40 2018) by ROOT version6.02/05 TCanvas *c = new TCanvas("c", "c",0,0,600,700); gStyle->SetOptStat(0); gStyle->SetOptTitle(0); c->SetHighLightColor(2); c->Range(0,0,1,1); c->SetFill...
#include "libwchar.h" static const char _u8cmaxlen = 4; static const char _u8bit = '\x80'; static const char _u8bits[] = {'\x0', '\xc0', '\xe0', '\xf0', '\xf8', '\xfc'}; static const wchar_t _wcsrange[] = { L'\x0', L'\x80', L'\x800', L'\xfffe' }; static const char _u8vallen = 6; size_t u8stowcs(wchar_t *wcs, const c...
/******************************************************************************* * Application: Demo code for IIC using in HHD32F0xx * Edition: Version:1.0 * Company: * Time: October 2015 *******************************************************************************/ #include "hhd32f1xx.h" #include "hhd_sys.h" ...
/* Copyright (C) 2017-2018 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted for any purpose (including commercial purposes) * provided that the following conditions are met: * * 1. Redistributions of source code must ret...
#include "sp_fetchmail.h" #include <string.h> #include <strings.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> #if 0 /* https://technet.microsoft.com/en-us/library/bb331962(v=exchg.141).aspx *first mimepart fields: * * Basic fields: * Sender * Subject * Message-ID * Recipient * * Exte...
/** * @file mesherror.c * @author Sk. Mohammadul Haque * @version 1.8.0.0 * @copyright * Copyright (c) 2013-2021 Sk. Mohammadul Haque. * @brief This file contains functions pertaining to handling errors. */ #include "../include/meshlib.h" /** \brief Displays error message and exits * * \param[in] type Error ...
#include "led.h" void LED_OPEN() { GPIO_ResetBits(GPIOB,GPIO_Pin_0); } void LED_CLOSE() { GPIO_SetBits(GPIOB,GPIO_Pin_0); } void LED_init() { GPIO_InitTypeDef GPIOB_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE); GPIOB_InitStructure.GPIO_Pin = GPIO_Pin_0; GPIOB_InitStructu...
0001000002000337 */ /* inherited classes #ifndef _OZ0001000002000064P_H_ #define _OZ0001000002000064P_H_ #define OZClassPart0001000002fffffd_0_in_0001000002000064 1 #define OZClassPart0001000002fffffe_0_in_0001000002000064 1 #define OZClassPart0001000002000336_0_in_0001000002000064 -1 #define OZClassPart000100000200...
#include<GL/glut.h> #include<stdio.h> #include<stdlib.h> #include<GL/gl.h> #include<string.h> #define safesending 2 #define packetcrashing 3 #define timeout 4 #define one 6 #define mainmenu 16 #define sendop 17 #define dx 15 #define dy 25 int window; int flag=0; char E[10]...
#include "common.c" static void dd_signal_handler(int sig) // metodo per la gestione dei segnali { if (sig == SIGTERM) { exit(EXIT_SUCCESS); } if (sig == SIGUSR1) { printf("%d è stato ammazzato \n", getpid()); exit(EXIT_SUCCESS); } } int main(int argc, char *argv[]) { int semID = semget(KEY, 1, 0); //...
/* 18dec18abu * (c) Software Lab. Alexander Burger */ #include "pico.h" /* Internal/transient hash */ unsigned long ihash(any x) { unsigned long g, h; word n; for (h = 0; isNum(x); x = cdr(numCell(x))) for (n = unDig(x); n; n >>= 8) g = (h = (h<<4) + (n&0xFF)) & 0xF0000000, h = (h ^ g>>24)...
#include "contoh_while.h" #include <stdio.h> void contohWhile() { /* definisi variabel lokal */ int a = 10; /* eksekusi perulangan While */ while( a < 20 ) { printf("nilai a: %d\n", a); a++; } }
#include <std.h> #include <daemons.h> #include <effect_cl.h> #define FAIL(s) return notify_fail(s+"\n") #define RES "%^RESET%^" #define COL "%^GREEN%^" #define COL2 "%^RED%^" #define MAX_PERC 175 inherit DAEMON; void start_buff(object, object, int, int, int, int); void end_buff(class Effect); int spell() { obj...
#include<stdio.h> int main(){ FILE *fp; fpos_t pos; fp=fopen("file.txt","w+"); fputs("Hello", fp); fgetpos(fp,&pos); fputs("walk", fp); fsetpos(fp,&pos); fputs("world",fp); fclose(fp); return 0; }
#include<stdlib.h> #include<stdio.h> #define MAX_OP 5 #define operator(ch) ((c=='+')||(c=='-')||(c=='*')||(c=='/'))?1:0 #define operands(ch) ((c)>='a' && (c)<='z')?1:0 #define MAX_ITEM 100 typedef struct tagStack{ int item[MAX_ITEM]; int top; }Stack; Stack S; char op[MAX_OP]={'(', '+', '-', '*', '/'}; char prio[MA...
#include <stdio.h> #include <stdlib.h> #define LIMIT 100 int stack[LIMIT]; int top; int i; int choice; void push(); int pop(); void display(); int add(int a,int b){ return a+b; } int multiply(int a,int b){ return a*b; } int main() { push(10); display(); push(-3); display(); int one = ...
/** ****************************************************************************** * @file rtc.h * @brief This file contains all the function prototypes for * the rtc.c file ****************************************************************************** * @attention * * <h2><center>&copy; C...
/** * @file calculator.c * @author Lukas Zronek * @date 28.10.2016 * @brief a user-friendly calculator (simple) * @version 1.0 * */ #define _POSIX_C_SOURCE 200809L #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <errno.h> #include <assert.h> void print_usage(void); int m...
/* Copyright 2020 Jaakko Keränen <jaakko.keranen@iki.fi> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <sys/un.h> #include <netinet/ether.h> #include <pthread.h> #include <arpa/inet.h> #include <string.h> #include <assert.h> #include <net/ethernet.h> #define ENTRIES 10 struct bpdu { uint8_t llc[3], ve...
/* * Exported with nin10kit v1.7 * Invocation command was nin10kit --mode=3 --resize=8x8 image_empty image_empty.png * Time-stamp: Monday 11/04/2019, 19:22:10 * * Image Information * ----------------- * image_empty.png 8@8 * * All bug reports / feature requests are to be filed here https://github.com/Tricks...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* actions.c :+: :+: :+: ...
void handle_hw_int(void) { /* nothing */ } int n = 7; int a[15] = {21, -312, 37, -42, 75, 29, 1324}; int b[15]; void bubble_sort() { int i, j, tmp; for (i=0; i<n; ++i) b[i] = a[i]; for (i=0; i<n; ++i) { for (j=i+1; j<n; ++j) { if (a[i] > a[j]) { tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } } ...
#include <sys/types.h> #include <stdio.h> #include <unistd.h> int able; void fork_example() { printf("fork number = %d \n",++able); pid_t pid; pid = fork(); int a = 5; if(pid<0) { printf("error occured\n"); } else if(pid==0) { printf("%d\n", getpid()); printf("child is executed x = %d \n", a +5); }...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * License); you ma...
/* @(#)spell.h 1.2 (ULTRIX) 8/13/85 */ /************************************************************************ * * * Copyright (c) 1985 by * * Digital Equipment Corporation, Maynard, MA * * All rights reserved. * * * * This software is furnished under a license and may be used an...
#define _PROTECTED_ALL_000100000200030f_H #ifndef _OZ000100000200030fP_H_ #define _OZ000100000200030fP_H_ #define OZClassPart0001000002fffffd_0_in_000100000200030e 1 #define OZClassPart0001000002fffffe_0_in_000100000200030e 1 #define OZClassPart000100000200030e_0_in_000100000200030e 0 typedef struct OZ0001000002000...
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * <h2><center>&copy; Copyri...
#define SIZE 5 struct stack{ int data[SIZE]; int top; } s; void push(int item) { if(!full()){ s.top++; s.data[s.top] = item; } else printf("Stack is full"); } int pop() { if(!empty()){ int item = s.data[s.top]; s.top--; return item; } else return -999; } int full(){ if(s.top==SIZE-1) return 1; e...
#include <stdio.h> #include "heap.h" #include "dll.h" void printTree(tree *t) { if (t) { printf("<"); printTree(t->l); printf(" %d ", t->x); printTree(t->r); printf(">"); } } void main() { int items[] = {4,-2,5,92,-5,-2,8}; tree *heap = heapify(items, sizeof(items) / sizeof(items[0])); p...
/* See LICENSE file for copyright and license details. */ /* appearance */ static const unsigned int borderpx = 0; /* border pixel of windows */ static const unsigned int snap = 8; /* snap pixel */ static const unsigned int gappih = 3; /* horiz inner gap between windows */ static const uns...
# ifndef _AVOIDOBSTACLE_H_ # define _AVOIDOBSTACLE_H_ # define Ultrasound_Uart_Port LPUART6 typedef enum { Meassuring, Meassured, Error }Enum_UltrasoundMeassure; extern Enum_UltrasoundMeassure UltrasoundMeassure; # define MaxMeassureRangeSetCMD_50cm 0x05 // 3885us # define MaxMeassureRangeSetCMD_100cm 0...
/* ** EPITECH PROJECT, 2020 ** MY_RPG ** File description: ** .h for sm1_init.c */ #ifndef MY_PLAYER_MOVEMENT_H_ #define MY_PLAYER_MOVEMENT_H_ #include "../include_all.h" #include "main.h" void player_move(main_t *main_struct); int check_cols_right(main_t *main_struct); int check_cols_left(main_t *main_struct); int ...
#include <std.h> #include <amun.h> inherit WEAPON; int weapon_hit(); create() { ::create(); set_name("Pumpkin"); set("id", ({ "pumpkin" }) ); set("short", "%^RESET%^%^ORANGE%^Pum%^BOLD%^%^BLACK%^p%^RESET%^%^ORANGE%^kin%^RESET%^"); set("long", "%^RESET%^%^ORANGE%^This pumpkin is lit with fire. The H...
#include "client.h" int main(int argc, char **argv) { /* 格式:./client -ip set_ip(点分格式,例如127.0.0.1) -port set_port */ for (int i = 1; i < argc; i++) { if (strcmp(argv[i], "-ip") == 0 && argv[i+1] && strcmp(argv[i+1], "-port") != 0) { memset(set_ip, 0, 20); strcpy(set_ip, argv[i+1]...
/* **************************************************************** * * * bits.c * * * * Output variable-length bit strings * * * * Versão 3.0.0, de 05.06.93 * * 3.0.0, de 09.06.93 * * * * Módulo: GZIP * * Utilitários de compressão/descompressão * * Categor...
/** * [POLYTECH APP3] Projet base de developpement en C * Detcheberry Valentin * Vuillemin Anthony */ #ifndef IMAGE_TOOLS_COMMAND_LINE_INTERFACE_H #define IMAGE_TOOLS_COMMAND_LINE_INTERFACE_H #include <stdio.h> #include <stdlib.h> #include <string.h> #include "basic_tools.h" #include "PGM_P2.h" #include "BMP.h" ...
#include<stdio.h> int main() { int p; scanf("%d",&p); while(p--) { unsigned long long int n,k,m,s=1,t=0; scanf("%llu %llu %llu",&n,&k,&m); if(n>m) printf("0\n"); else { while(s<=m/n) { s=s*k; ...