language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #ifndef DEVICES_H__
#define DEVICES_H__
//! The number of possible client devices connecting to the system.
const char* devices[] =
{
"iPhone",
"iPad",
"Desktop",
"Android"
};
//! Number of possible clients.
static const unsigned int deviceCount = sizeof(devices) / sizeof(devices[0]);
//! Lowest possible rat... |
C | //α 3. ִ ּڰ ã α
#include <stdio.h>
#define SIZE 10
int main()
{
int data[SIZE] = { 23, 45, 62, 12, 99, 83, 23, 50, 72, 37 };
int max = data[0], min = data[0], i;
printf("迭: ");
for (i = 0; i < SIZE; i++)
printf("%2d ", data[i]);
printf("\n");
for (i = 0; i < SIZE; i++)
if (max < data[i])
{ //data[i... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h"
#include "esp_system.h"
#include "esp_log.h"
static const char *TAG="xQueue Test";
static xQueueHandle testQueueHandle=NULL;
static void sendQueueTask(void *arg )
{
char *Q... |
C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<ctype.h>
int getop(char []);
void push(double);
double pop(void);
int getch(void);
void ungetch(int);
void ungets(char []);
char buf[100];
int bufp = 0;
int main(void)
{
char str[100];
int c;
printf("Enter the line");
scanf("%s",str);... |
C | #include "000_ControlCase.h"
#if _031_RESIZETERMINAL2
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <ncurses.h>
int main(void) {
initscr();
/* -----------------------------------------------------------------------------------------------------------------------*/
WINDOW *ventana1... |
C | /* Demo Program of sorting using insertion sort */
#include<stdio.h>
#define MAX 100
#define STOP getchar()
main()
{
int arr[MAX],i,j,k,n,l;
printf("Enter the number of elements : ");
scanf("%d",&n);
for( i=0; i<n; i++ )
{
printf("Enter element %d : ",i+1);
scanf("%d", &arr[i]);
}
print... |
C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<windows.h>
#include<conio.h>
#include"functions.c"
enum commands {help, blowup, delete, change, xchange, words, wordnumber, maxword, strsize, straus, letters, shorten, incorrect, fuck};
int main (void){
char defaultString[80];
startConsole();
int che... |
C | /** \mainpage FileMan
Most unused ncurses file manager.
*/
#include <stdio.h>
#include <ncurses.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <panel.h>
#include <unistd.h>
#include <sys/wait.h>
#include <string.h>
#ifndef FILEMAN_H
#define FILEMAN_H
///Set maximum path length.
#define BUF_PA... |
C | #include<stdio.h>
void main()
{
int a,b;
printf("\n Enter the positive number");
scanf("%d",a);
printf("\n Enter the negative number");
scanf("%d",b);
printf("\n enter the positive&negative");
{
getch();
}
}
|
C | /*
* This is stage 2 of TehBoot
*/
#include "vga.h"
/*
* Get the message of the day
* to display to the user
*/
#include "tehboot_motd.h"
/*
* Main entry point for teh boot.
*/
int main() {
/* VGA color */
vga_color_t color;
/* Clear the vga buffer */
vga_clear();
/* Print things in whit... |
C | #include <stdlib.h>
#include <stdio.h>
char *ft_strmapi(char const *s, char *(f)(unsigned int, char))
{
char *arr;
unsigned int len;
unsigned int i;
if (!s) // protect
return (0);
len = strlen(s);
arr = (char *)malloc(len + 1);
if (!arr)
return (0);
i = 0;
while (i < len)
{
arr[i] = f(i, s[i]);
i... |
C | #include <stdio.h>
#include <stdlib.h>
int main() {
//declare an unsigned int > 2.1 billion and its pointer
unsigned int num = 3100000000;
char * pointer = #
printf("int num: %x \n", num);
printf("address of num: &ld \n", *pointer);
//printing bytes
for (int i = 0; i< sizeof(num); i++) {
printf... |
C | /*
* Part of esp-open-rtos
* Copyright (C) 2016 Jonathan Hartsuiker (https://github.com/jsuiker)
* BSD Licensed as described in the file LICENSE
*
*/
#ifndef __DHT_H__
#define __DHT_H__
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* Sensor type
*/
ty... |
C | #include "mystring.h"
Status StringInit(ElemType **T)
{
ElemType *p = NULL;
if(*T != NULL) return ERR;
p = (ElemType *)malloc(sizeof(ElemType)*MAXSIZE);
if(p == NULL) return ERR;
*T = p;
return OK;
}
int StringLength(ElemType *T)
{
int i = 0;
char p;
if(T == NULL) return -1;
p ... |
C | #include "parser.h"
int activeToken = FALSE;
int line_no = 1;
void skipSpace()
{
char c;
c = getchar();
line_no += (c == '\n');
while (!feof(stdin) && isspace(c))
{
c = getchar();
line_no += (c == '\n');
}
ungetc(c, stdin);
}
void ungetToken()
{
activeToken = TRUE;
}
int sca... |
C | #include "basicgeometricdist.h"
#include <math.h>
#include <string.h>
typedef struct pcg_state_setseq_64 { // Internals are *Private*.
uint64_t state; // RNG state. All values are possible.
uint64_t inc; // Controls which RNG sequence (stream) is
... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<errno.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#define MAX_TEXT 512
struct my_msg_st{
long int my_msg_type;
char some_text[MAX_TEXT];
};
int main()
{
int running = 1;
int msgid;
int num=0;
char bu... |
C |
#include "../include/connmgr.h"
static conmgr* mgr = 0;
void createConMgr(int maxcon){
mgr = malloc(sizeof(conmgr));
if(!mgr){
return -1;
}
mgr->conlist = malloc(sizeof(connection*)* maxcon);
if(mgr->conlist){
free(mgr);
return -1;
}
mgr->maxcon = maxcon;
retu... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* p_get_floor.c :+: :+: :+: ... |
C | /* 7-20 Binary Search Tree */
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define MAX_NODES 10
#define MAX_TEST 1000
typedef int ElementType;
typedef struct BSNode *BinTree;
struct BSNode{
ElementType Data; /* 结点数据 */
BinTree Left; /* 指向左子树 */
BinTree Right; /* 指向右子树 */
... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int notas;
int edad;
char sexo;
int acomuladorProm = 0;
float promedio;
int notaMasBaja;
char sexoNotaMasBaja;
int contadorMayoresYNota;
int MasJoven;
int NotaDelMasJoven;
char sexoMasJoven;
in... |
C | #include <stdio.h>
int main(){
unsigned char a = 181;
char b = -75;
int i;
for(i=7;i>=0;i--){
printf("%d", (a>>i)&0x01);
}
printf("\n");
int j;
for(j=7;j>=0;j--){
printf("%d", (b>>j)&0x01);
}
printf("\n");
} |
C | /* WARNING if type checker is not performed, translation could contain errors ! */
#include "DATA_BASE.h"
/* Clause SEES */
#include "BASIC_IO.h"
#include "BASIC_SEX.h"
#include "BASIC_STATUS.h"
/* Clause IMPORTS */
#include "PARTIAL_OBJECT.h"
/* Clause CONCRETE_CONSTANTS */
/* Basic constants */
#d... |
C | //problems5-center.c
//5. Longest Palindromic Substring
//Solution: Dynamic Programming
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define TRUE (1)
#define FALSE (0)
typedef char BOOL;
char result[1001] = "";
char* longestPalindrome(char* s)
{
int i, j;
int maxi = 0, maxj = 0;
... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* tetri_utils.c :+: :+: :+: ... |
C | /*
*********************************************************************************************************
* WMDP
* WM Develop Platform
*
* (c) Copyright 2010-2014, WM, China
* ... |
C | //
// File: wl.h
//
// Description: This program will assist the user to check for occurrence(s) for a word in a text file.
// Student Name: Liang Zheng Gooi
// UW Campus ID: 9066169518
// email: lgooi@wisc.edu
// time: Jan 31, 2012 10.39pm
/*
* @brief This program helps to detect occurrence of a word
* @au... |
C | // BREAK EXAMPLE EXPLANATION
/* break simply offers an early termination of a while, do-while, or for loop. break cant exit from if, which isnt
a loop statement. */
#include <stdio.h>
main()
{
// SET UP VARIABLES
int i, num;
printf("How many numbers do you want to see?");
sca... |
C | #include "FileLocker.h"
//
// [ FileLocker.c Info ]
// FileLocker Use AES-256 for en/decryption.
// Key length is 32byte(256bit) cipher block size is 16byte.
// File chunk-block size is 1024byte.
//
// (1) Encryption
// 1. Read File 1 ~ sizeof(FileBlock.abData) (as much as file remains, max:sizeof(FileBlock.abData))
/... |
C | Q.Write a program that prints the numbers from 1 to 100 and for multiples of '3' print "Fizz" instead of
the number and for the multiples of '5' print "Buzz".
#include<stdio.h>
void buzzfizzprint()
{
for(int i=1;i<=100;i++)
{
if(i%3==0 && i%5==0)
{
printf(" Fuzz Buzz,");
}
... |
C | #include "../Main.h"
#include "../Drivers/Port.h"
#include <stdio.h>
#include "../Drivers/UART.h"
#include "../Drivers/Timing.h"
#include "../Drivers/memory_test.h"
#include "print_bytes.h"
#include "../Modules/LCD.h"
#include "../Drivers/Memory.h"
#include "../Drivers/SPI.h"
#include "../Modules/SDCard.h"
#include "L... |
C | #include <stdio.h>
#include <stdbool.h>
void tela_principal();
void menu_inicial();
void dispara_funcao();
void insere_usuario();
void remove_usuario();
void insere_troca();
void remove_troca();
void todas_trocas();
void todos_usuarios();
void ver_balanco();
void ver_vinculos();
void buscar_usuario();
void ultimas_tro... |
C | //
// C_Character_Input.c
// C_Learning
//
// Created by shiji zhao on 12/17/19.
// Copyright © 2019 shiji zhao. All rights reserved.
//
#include <stdio.h>
int main(){
char chr;
printf("Enter a character: ");
scanf("%c", &chr);
printf("You entered %c.\n", chr);
return 0;
}
|
C | /*
* Aufgabe3.c
*
* Created on: 14.05.2017
* Author: SimonSchmieden
*/
#include <stdio.h>
int cube[3][2][4] = {{{1,2,3,4}},{{2,3},{4,6,8,10}},{{3,4,5,6},{6,8,10}}};
int main(void){
int x=1,y=1,z=2;
int *p = &cube[0][0][0];
int *vptr = &cube[x][y];
int *mptr = &cube[x];
printf("%d\n", cube[x][y][z]);
... |
C | #include "stdio.h"
#include "string.h"
#include "stdlib.h"
#define N strlen(g)
char t[128],cs[128],g[]="10001000000100001", z[128];
int e, a, c;
void xor() {
printf("\n");
for(c = 1; c < N; c++)
{cs[c] = ((cs[c] == g[c]) ? '0' : '1');
printf("%c", cs[c]);}
printf("\n");
}
void crc() {
printf("\n");
for(e =... |
C | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include "pagetable.h"
#include "sim.h"
//---------------------------------------------------------------------
// Bitmap definitions and functions to manage space in ... |
C | #ifndef SLAE_H
#define SLAE_H
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<math.h>
//*******************************************************************
double* methodGauss02(const double* pA, //Matrix of system: n*n
const double* pB, //Vector of free terms: n*1
int n //n
... |
C | #include <stdio.h>
#include "main.h"
#define SIZEOF(x) (sizeof(x) / sizeof((x)[0]))
int main(){
char socks[] = "AA";
char socks2[] = "ABABC";
char socks3[] = "";
char socks4[] = "Cc";
if(sockPairs(socks,SIZEOF(socks)) == 1){
printf("test 1 passed\n");
}
if(sockPairs(socks2,SIZEOF(socks2)) == 2){
printf("test... |
C | #include<stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <unistd.h>
#define MAGIC_WORD "sp3akfr1end4nd3nt3r"
int main() {
char input[255];
char flag[255];
scanf("%254s", input);
printf("You said: %s\n", input);
if (strcmp(input, MAGIC_WORD) == 0)... |
C | #include<stdio.h>
void nhap(int *arr, int *n){
while(*n<=0){
printf("nhap n>0");
scanf("%d", n);
}
int i;
for(i=0; i< *n; i++){
printf("\narr[%d]= ", i);
scanf("%d", &arr[i]);
}
}
void minMax(int *arr ,int *min , int *max , int n){
*min=*max=arr[0];
int i;
... |
C | #include "stack.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int stack_init(struct stack *s)
{
memset(s, 0, sizeof(struct stack));
s->top = -1;
return 0;
}
int stack_empty(struct stack *s)
{
if (s->top < 0) {
return 1;
}
return 0;
}
int stack_full(struct stack *s)
{
if (s->top >= STACK_D... |
C | #include "order_overview.h"
#include "elev.h"
int orders[4][3] = {{0}};
int orders_amount = 0;
void oov_set_order(int floor_nr, int button, int value){
//Neste linje sjekker om knappen ikke er en av de to ugyldige knappene, OG om bestillingen ikke allerede har den verdien
if(!((floor_nr == 0 && button == BUTTON_CAL... |
C | /*
Copyright (c) 2003 by Juliusz Chroboczek
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 use, copy, modify, merge, publ... |
C | #include "holberton.h"
#include <stddef.h>
/**
* compare - compares two strings
* @haystack: source string
* @needle: string being compared
* Description: checks if needle is at start of haystack
* Return: 1 if matches, 0 if not
**/
int compare(char *haystack, char *needle)
{
int i;
for (i = 0; needle[i] != '... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_f_add.c :+: :+: :+: ... |
C | #include "p1.h"
/*Simple Stack to use for the printing
of the moves to get to the final state.
Then loop in p1.c will backtrace and add
to the stack and then pop the off when
printing them.
*/
LINKEDLIST *Stackhead;
int stackSize = 0;
void addStack(unsigned int val) {
LINKEDLIST *ptr;
ptr = malloc(siz... |
C | #include <stdio.h> // para entrada e saida
#include <string.h> // para eu manipular as strings
#include <stdlib.h> // para as macros e funçao de conversão
//preferi usar struct pra organizar melhor os vetores
typedef struct DataBase{
char *pass; //alocado dinamicamente
} DataBase;
//prototipagem das funç... |
C | #include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<string.h>
struct data {
int front;
int back;
int row;
int col;
int id;
};
struct data input[814];
int main()
{
FILE *fp;
fp = fopen("input.txt","r");
int i,j,freq = 0;
while(!feof(fp))
{
input[i].front =... |
C | #include <stdio.h>
void swap(int *i, int *j) {
int temp = *i;
*i = *j;
*j = temp;
}
void BubbleSort(int arr[], int size) {
int total_step = size - 1;
int i, j;
int largest;
int count = size-1;
for (i = 0;i < total_step;i++) {
printf("%d step : ", i+1);
for (j = 0;j < count;j++) {
i... |
C | #include "t3c.h"
#include <stdlib.h>
#include <stdio.h>
short **Co;
short **Cg;
short **Y;
void td (short *x, short *y, int N)
{
short *s, *d;
short p, n;
p = N >> 1;
s =(short *)malloc(p*sizeof(short));
if(s==NULL){
printf("Memorie insuficienta !\n");
return;
}
d =(short *)malloc(p*sizeof(sho... |
C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "cs392_midterm.h"
int test_cs392_strcpy(){
char src[200];
char dest[200];
char index[] = {30, 60, 90, 120, 150};
int test_index;
char tmp_index;
int success;
success = 0;
for(test_index = 0; test_index < 4; test_index++){
memset(dest, 1, 20... |
C | #include "slide_line.h"
#include <stdlib.h>
/**
* left - Move the direction to the left
*
* @line: points to an array of integers containing size elements
* @size: Number of elements in @array
*/
void left(int *line, size_t size)
{
size_t i, j, k;
for (i = 0, j = 0; i < size;)
{
if (line[i] == 0)
for (;... |
C | #include <stdlib.h>
#include <math.h>
#include <stdio.h>
int PrintSquareRoot()
{
printf("Square root of 12345 is %lf\n", sqrt(12345));
return (EXIT_SUCCESS);
}
/*
int PrintSquareRootFromConsole(double squareRoot)
{
printf("Square root of %lf is %lf\n", squareRoot, sqrt(squareRoot));
return(EXIT... |
C | #include <std.h>
inherit ARMOUR;
int tracker;
void create(){
::create();
set_name("armlet");
set_id(({ "armlet", "silver armlet", "armlet of the feline", "feline armlet", "arm let", "armband", "arm band" }));
set_short("%^BOLD%^%^WHITE%^Armlet of the %^BLACK%^F%^RESET%^%^GREEN%^e%^BOLD%^%^BLACK%^li%^RESET%^%^GREEN... |
C | #include <types.h>
#include <lib.h>
#include <array.h>
#include <test.h>
#define TESTSIZE 73
static
void
testa(struct array *a)
{
int testarray[TESTSIZE];
int i, j, n, r, *p;
for (i=0; i<TESTSIZE; i++) {
testarray[i]=i;
}
n = array_getnum(a);
assert(n==0);
for (i=0; i<TESTSIZE; i++) {... |
C | /* resched.c - resched */
#include <conf.h>
#include <kernel.h>
#include <proc.h>
#include <q.h>
#include <sched.h>
int flag;
unsigned long currSP; /* REAL sp of current process */
extern int ctxsw(int, int, int, int);
void linux_sched();
void roundrobin_sched();
void setschedclass(int sched_class);
i... |
C | #include<stdio.h>
#include<stdlib.h>
#define MAXTAM 20
typedef int TipoChave;
typedef struct TipoItem {
TipoChave Chave;
} TipoItem;
typedef int TipoIndice;
typedef TipoItem TipoVetor[MAXTAM];
void selecao(TipoItem A[], TipoIndice n){
TipoIndice i, j, min;
TipoItem x;
for (i = 0; i <= n - 1; i++){
min = i;
... |
C | #include <xc.h>
#include <stdint.h>
#include "LDR.h"
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/*
* Funcin: ConfigADC
*
* Descripcin: Configura ADC - AN0, AN1, se usar VDD y VSS, Adquisicin
* manual, Fosc/4 (por trabajar a 4MHz)
* Entradas Ninguna
* Salidas Ni... |
C | #pragma once
// Generates data for a Fibonacci heap
#include <string.h>
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#define MAX_LEN (2000000)
#define MIN_LEN (100000)
#define DIF_LEN (100000)
#define BIAS (1000)
#define NAIVE_MAX (27)
#define NAI... |
C | #include <stdio.h>
int binarySearch(int vector[], int sizeVector, int key) {
int min = 0;
int max = sizeVector - 1;
int middle;
while(min <= max) {
middle = (min + max) / 2;
if(vector[middle] == key) {
return middle;
}else if(key < vector[middle]) {
max ... |
C | /**
* @brief 调用ASM获取当前运行CPU的唯一编号(LINUX only)
* @param cpu_id 输出CPU唯一编号的字符串,原有字符串内容会被清空。
*
* @return 是否获取成功
* -<em>true</em> 获取CPUID成功。
* -<em>false</em> 获取CPUID失败。
* @note 函数会在堆上分配空间返回结果,如果是长期运行的调用,请确保使用free对返回结果显示
*/
//int get_cpu_id_c(char* cpu_id);
#ifdef __cplusplus
extern "C"
{
#endif
char* get_cpu_... |
C | #include<stdio.h>
int main()
{
int i=1;
while(i<=6){
printf("%d\n",i);
i=i+2;}
return 0;
}
|
C | #include <stdio.h>
int main() {
int qtde_minima, qtde_maxima;
float estoque_medio;
printf("Informe a qtde minima");
scanf("%d", &qtde_minima);
printf("Informe a qtde maxima");
scanf("%d", &qtde_maxima);
estoque_medio = (qtde_minima + qtde_maxima) / 2;
printf("informe o resultado %.2f", estoque_medio);
}
|
C | #include<stdio.h>
int main()
{
int n,p;
printf("\t Enter the Number:");
scanf("%d",&n);
p=(n&&(n-1));
if(p==1)
printf("Yes",n);
else
printf("No",n);
return (0);
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct
{
int id;
char nombre[50];
char apellido[50];
float salario[];
}eEmpleado;
eEmpleado* new_empleado();
int main()
{
FILE* pArchivo;
char linea[20];
char legajo[20];
char nombre[20];
char ape... |
C | // Hannah Gulle
// CSC 460 Dispatcher Project
// Due 04/12/2019
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <time.h>
int LEFT( int i );
int RIGHT( int i );
void P( int s, int sem_id );
void V( int s, int sem_id );
// Process in... |
C | /* strindex: return index of t in s, -1 if none */
#include <stdio.h>
int main()
{
char s[200], t[100];
int strindex(char *, char *);
printf("\nEnter String1 : ");
scanf("%s", s);
getchar();
printf("\nEnter String2 : ");
scanf("%s", t);
getchar();
printf("\nResult : %d\n", strindex... |
C | #include<stdio.h>
#include<string.h>
int main(void)
{
char str[5];
int i,length,temp=0;
printf("\nEnter the char\n");
scanf("%s",&str);
length=strlen(str);
for(i=0;i<length;i=i+2)
{
if(str[i+1]!=0)
{
... |
C | #include <stdio.h>
#define SIZE 3
main(){
int i;
float temps[SIZE];
printf("Please insert 3 temperatures in Farenheit:\n");
for(i=0; i<SIZE; i++){
scanf("%f", &temps[i]);
}
for(i=0; i<SIZE; i++){
printf("Farenheit %d: %f\n",i+1,temps[i]);
temps[i]=(temps[i]-32.0)*(5.0/9.0);
printf("Celsius %... |
C | //CREU
// Gabriel Gomes, Pedron Schaper, Filipe ..., Arthur ...
#include<stdio.h>
#include<stdlib.h>
struct tipo_vizinho{
int vertice;
struct tipo_vizinho *proximo_vizinho;
}typedef vizinho;
struct tipo_vetor{
int vertice;
int cor;
struct tipo_vetor *proximo_vertice;
vizinho *primeiro_vizinho;
}typedef ... |
C | #include <stdio.h>
void fileCopy(char * src, char * des)
{
FILE * read = fopen(src, "rb");
FILE * write = fopen(des, "wb");
FILE * error = NULL;
char buffer[1024];
int counting;
if(read == NULL || write == NULL) {
error = fopen("error.txt", "wt");
fputs("파일을 읽거나 생성할 수 없습니다.\n", error);
if (error != NULL)... |
C | # include <stdio.h>
# define N 20
int main() {
int arr[N][N], n;
printf("\nEnter the number of elments: ");
scanf("%d", &n);
for(int i=0; i<n; i++) {
for(int j=0; j<n; j++) {
arr[i][j] = i+j+1;
}
}
int product = 1;
for(int i=0; i<2; ++i) {
for (int j = 1; j < 3; ++j) {
product *= arr[i][j]... |
C | #include<stdio.h>
main()
{
char s[10],s1[10];
int i,ele;
printf("Enrer Strings\n");
scanf("%s%s",s,s1);
ele=sizeof(s)/sizeof(s[0]);
for(i=0;i<=ele;i++)
{
if(s[i]!=s1[i])
break;
}
s[i]==s1[i]?printf("Equal\n"):printf("not equal\n");
}
|
C | #include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int cd(char *home_directory, char *new_directory)
{
if(new_directory == NULL){
chdir(home_directory);
// getcwd(current_directory, 256);
return 0;
}
// printf("%s\n%s\n", home_directory, new_directory);
... |
C |
#include <stdbool.h>
#include <stdint.h>
#define QSIZE 20
typedef int32_t elemT;
typedef struct {
int fHead;
int fTail;
int fValues[QSIZE];
} TQueue;
void TQueue_Init(TQueue* self);
int TQueue_Push(TQueue* self, int v);
bool TQueue_Pop(TQueue* self, int *v);
|
C | #include "select.h"
void selecao(selec *alec){
int i, j,min;
int n=alec->quantidade;
item aux;
for(i = 0; i<= n-1 ;i++){
min = i;
for (j = i + 1; j <= n ; j++){
if (alec->itens[j].valor < alec->itens[min].valor){
min=j;
}
}
... |
C | #include "Snake.h"
#include "xmath.h"
#include <stdlib.h>
void init_snake(snake_t* s, int x, int y, int field_width, int field_height, int tile_size, int game_mode)
{
body_t* b;
s->body.x = x;
s->body.y = y;
s->dir = 4;
s->field_width = field_width;
s->field_height = field_height;
s->tile_size = tile_size;
... |
C | #include "DeliveryVehicleList.H"
listItem::listItem(DeliveryVehicle* item) {
item_ = item;
back_ = NULL;
next_ = NULL;
}
DeliveryVehicle* listItem::item() {
return item_;
}
listItem* listItem::next() {
return next_;
}
void listItem::nextSet(listItem* next) {
next_ = next;
}
listItem* listItem::bac... |
C | /*
MyHello.c
Evan Li 1682859 CSE15 10/5/19
Main c program for lab1
Defines strings and prints them to
a greet and introduce my name
*/
#include <stdio.h>
#include <stdlib.h>
#define HELLO_STRING "Hello World!"
#define NAME_STRING "Evan Li"
int main() {
printf(HELLO_STRING " My name is " NAME_STRING ".\n");... |
C | #include <wom.h>
#include <stdio.h>
char **parse_args(int argc, char **argv)
{
char **entries;
int i = 0;
if (!(entries = malloc(argc * sizeof(char*))))
return (NULL);
while (i < argc - 1)
{
if (is_sh(argv[i + 1]))
{
if (!(entries[i] = strdup(argv[i + 1])))
return (NULL);
}
++i;
}
entries[i] ... |
C | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
// 파라미터로 주어지는 문자열은 const로 주어집니다. 변경하려면 문자열을 복사해서 사용하세요.
int main(void) {
int answer = 0;
int sign, flag, sIdx, cnt, nIdx;
int* ps;
char number[10];
char s[10] = "+1234";
ps = &s[0];
flag = 0;
nIdx = 0;
for (cnt = 0; cnt < 1... |
C | /*
* Archivo: tcpcliente.c
*
* Este archivo contiene todo lo referente al cliente, verificación de la
* entrada en el terminal, conexión que se realiza a través del socket con el
* servidor, y el intercambio de mensajes necesarios entre el cliente y servidor
*
* Autores: Cristina Betancourt # Carnet 11-10104
... |
C | #include "keycommand.h"
void keyDown(struct command *trigger) {
if(trigger->pressed == 0) {
trigger->pressed = 1;
if (trigger->key >= 0) {
// press key
src = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
keyButton = CGEventCreateKeyboardEvent(src, (C... |
C | #include <stdlib.h>
#include <stdio.h>
int main()
{
int n, i, index = 0, sum;
printf("Input n:");
scanf("%d", &n);
int* ps = calloc(n, sizeof(int));
sum = n;
for (i = 0; i < n; i++)
{
*(ps + i) = i + 1;
}
while (n != 1)
{
for (i = 0; i < sum; i++)
{
if (*(ps + i) != 0)
{
index++;
if (inde... |
C | #ifndef EX_H
#define EX_H
#include <stdlib.h>
#include <stdbool.h>
// Linked list elem
typedef struct Llelem {
void* data;
struct Llelem *next;
} Llelem;
enum {
TAG_VAR,
TAG_APP,
TAG_IFZ,
TAG_LAMBDA,
TAG_PACK,
TAG_OPEN,
TAG_SUCC,
TAG_ZERO,
TAG_TYPE_LAMBDA,
TAG_TYPE_APP
};
enum {
TYPEC_INT,
... |
C | #include "battleship.h"
#ifdef __WIN32
/*
* Sets window size on Windows to a given width and height
*
* Parameters:
* width - number of characters displayed horizontally
* height - number of characters displayed vertically
*
* Return (void):
* Nothing
*/
void setWindowSize(int width, int height)... |
C | #include "lists.h"
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
/**
*add_nodeint_end - adds a new node at the end of a singly linked list
*@head: pointer to head of singy linked list
*@n: number to add as new node in the list
*
*Return: return the adress of the new element listint_t
*/
listint_t *a... |
C | #include <stdio.h>
int main(int argc, char * argv[])
{
switch (argc) {
case 1:
case 2:
printf("Sie haben weniger als 2 Parameter eingegeben");
break;
case 3:
printf("Sie haben genau 2 Parameter eingegeben");
break;
default:
printf("Sie haben mehr als 2 Parameter eingegeben");
}
return 0;
}
|
C | #include<stdio.h>
void reverseString(char* s, int sSize) {
if (sSize <= 1) {
return;
}
int end = sSize - 1;
for (int i = 0; i < end; i++, end--) {
char tmp = s[i];
s[i] = s[end];
s[end] = tmp;
}
}//תַ
int main() {
return 0;
} |
C | #include <stdint.h>
#include <unistd.h>
#include "mraa.h"
#include "BMA180.h"
// Global Variables
mraa_i2c_context i2c;
int ee_w;
int BMA180_init(uint8_t mode) {
i2c = mraa_i2c_init(0);
mraa_i2c_address(i2c,BMA180_I2C_ADDR);
if (read8(BMA180_CHIPID_ADDR) != BMA180_CHIP_IP) {
DEBUG_OUT("[BMA180]:Can not fin... |
C | #include <stdio.h>
int main()
{
int var = 5;
printf("var: %d\n", var);
//scanf("%d", &var);
printf("address of var: %p\n", &var);
// int* x
// int * x
// int *x
// int* p1, p2;
// int* pc, c
// c = 5;
// pc = &c;
// wrong // *pc = &c
// printf("%d", *pc) // 5
// ... |
C | #include <assert.h>
#include <stdio.h>
int bin_search(int *a, int length, int value)
{
int mid, low, high;
assert(length > 0);
low = 0;
high = length -1;
while(low <= high)
{
//mid = (low + high) / 2;
mid = low + ((high - low) >> 1);
if(a[mid] == value)
{
... |
C | /*int printf();
int malloc();
int roar(void)
{
int a;
return a;
}
int main(void)
{
int *x;
double *y;
int i;
x = &i;
x[3] = 4;
i = roar();
printf("i: %d\n", i);
}*/
int main(void)
{
char a, b, c, d, e[5];
int * i;
i = &(e[2]);
i[0] = 5;
printf("i[0]: %d\n",... |
C | #include <stdio.h>
#include <stdlib.h>
int main(){
Uma estrutura do tipo "Lista" é uma sequência
de elementos do mesmo tipo. Seus elementos
possuem estrutura interna abstraída, ou seja,
sua complexidade é arbitrária e não afeta seu funcionamento
Uma Lista pode possuir N ( N >= 0) elementos.
Se N = 0, dizemos que ... |
C | #include "../../Headers/Compiler/CommentsHandling.h"
int isComment(char *line) {
if (strlen(line) >= 2 && line[0] == '/' && line[1] == '/')
return 1;
return 0;
}
void commentCase(char *line) {
printf(ANSI_COLOR_MAGENTA "%s\n" ANSI_COLOR_RESET, line);
} |
C | #include <func.h>
int main()
{
int semid=semget(1010,2,IPC_CREAT|0600);
ERROR_CHECK(semid,-1,"semget");
unsigned short arr[2]={10,0};//10为仓库位置数,0为产品的个数
semctl(semid,0,SETALL,arr);
struct sembuf sopp,sopv;
if(!fork()){
sopp.sem_num=1;
sopp.sem_op=-1;
sopp.sem_flg=SEM_UNDO... |
C | #include <stdio.h>
int main(){
int userNum;
char userChoice;
int toContinue = 1;
int i = 1;
int boolean = 1;
while(1){
toContinue = 1;
i = 1;
userNum = checkInputInt("Enter a number (1-9): ", 1, 9);
printf("Multiplication table for %d number:\n", userNum);
for(; i < 11; i++){
printf("... |
C | /*Leia 1 valor inteiro N (2 < N < 1000). A seguir, mostre a tabuada de N:
1 x N = N 2 x N = 2N ... 10 x N = 10N
Entrada
A entrada contm um valor inteiro N (2 < N < 1000).
Sada
Imprima a tabuada de N, conforme o exemplo fornecido.
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <... |
C | #ifndef TRUE
#include "laba8_10_header.h"
#endif
#include "global_definition.h"
int first_letter_token(FILE* f)
{
char ch;
ch = fgetc(f);
if(ch == 'i' || ch=='d' || ch == 'f' || ch == 'w' || ch == 'e' || ch == 'p' || ch == 's')
return TRUE;
else
return FALSE;
}
char take_char_f(FILE* f)
{
int temp;
char ch;... |
C | ////////////////////////////////////////////////////////////////////////////////
/// \file del.h
/// \author Reetesh Dooleea
/// \author Freddy Some
/// \author Hicham Hamoumi
/// \author Yacine Hamdani
///
///Definitions du code pour controller la del.
//////////////////////////////////////////////////... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.