language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | /**
* Auteur: Seddar Naïm
* Création: 01/12/2020 18:17:34
* Dernière modification: 30/12/2020 12:16:38
* Master 1 Informatique
*/
#include <signal.h>
#include <fcntl.h>
#include <stdio.h>
#include "../includes/myssh-server.h"
#include "../includes/error.h"
int sockets[SOMAX... |
C | /**
* Author: Fateh Karan Singh Sandhu
* Collaborators: Saurav Pradhan, Saurav Kushwaha
* Date: October 30, 2018
*
* This file contains function headings
**/
/**
* Define a structure for airport
*/
typedef struct {
char *gpsID;
char *nameOfAirport;
char *typeOfAirport;
char *city;
cha... |
C | #include<stdio.h>
#include<string.h>
int main()
{
//get string
char s[100];
scanf("%s",s);
int n=strlen(s)-1;
int c=1;
//check whether 7 same charecters are entered next to one another
for(int i=0;i<n;i++)
{
if(s[i]==s[i+1])
c++;
else
c=1;
if(c=... |
C | #include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
int key = atoi(argv[1]); // here is key entered is converting to integer
for (int i=1; i<argc; i++) // here i am indicating that program st... |
C | /* ARRAY.c
* by Tim Müller
*
* Created:
* 28/04/2020, 19:36:38
* Last edited:
* 5/24/2020, 3:17:26 PM
* Auto updated?
* Yes
*
* Description:
* Defines a very simple array class that enhances usage of basic C
* arrays.
**/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "Array... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* julia.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <math.h>
#define OK 0
#define ERROR 1
#define EPS 1e-7
double side_len(double f_x, double s_x, double f_y, double s_y)
{
return sqrt(pow(s_x - f_x, 2) + pow(s_y - f_y, 2));
}
double area(double x1, double y1, double x2, double y2, double x3, double y3)
{
double len_fs, len_ss, len... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int print_floats(char * string_of_floats) {
char * pEnd, * pStart;
float f1;
pStart = string_of_floats;
pEnd = string_of_floats;
int len = strlen(string_of_floats);
int char_size = sizeof(char);
while (1) {
printf("Before: ... |
C | #include <stdio.h>
#include <util.h>
#include <math.h>
#include <stdlib.h>
#include "example0.h"
#define MEASURE_THRESHOLD 1e7
#define MEASURE_REPETITIONS 15
typedef void (*pointwise_add)(double *x, double* y, double *z, int N);
double measure(pointwise_add f, double *x, double *y, double *z, int N)
{
int runs =... |
C | /**
Relay (2 channels)
*/
/**
Initialize
=========1=========2=========3=========4=========5=========6=========7========*/
MyMessage msgA01a( A01a, V_STATUS );
MyMessage msgA01b( A01b, V_STATUS );
/**
Setup
=========1=========2=========3=========4=========5=========6=========7========*/
void setupA01ab(){
p... |
C | #include <stdio.h>
int main() {
int * pt;
int valores[100], i, count, tamanho, contador;
pt = valores;
printf("Digite o tamanho do array: ");
scanf("%d", &tamanho);
for(i = 0; i < tamanho; i++) {
printf("Informe um valor: ");
scanf("%d", &valores[i]);
}
for(i = 0; i < tamanho; i++) {
pr... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*
** clear the buffer to avoid scanf problems
*/
void clear_buffer(void)
{
int c;
while((c=getchar()) != EOF && c != '\n');
}
/*
** Say to the player that the number he chose is bigger or smaller (or same) as the "nombre mystere"
**... |
C | /* ===========================================
* Process structure
* Keeps process ID, status and exec time
* ===========================================
*/
#ifndef __PROCESS__
#define __PROCESS__
typedef struct _process {
int pid;
int status;
} process;
/* ===============================================... |
C | #include <stdio.h>
#include <math.h>
#define N 7
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n; i >= 0; --i)
#define FOR(i, n, m) for (int i = m; i < n; i++)
int main(void) {
int n;
double a[N][N+1], x[N];
printf("上三角型連立1次方程式の解法\n");
while (1) {
printf("未知数の... |
C | #include "server_utils.h"
#include "queue.h"
#include "dynamic_library_loader.h"
int main(){
// // Checking create named socket function
if(0!=make_named_socket(8080, 1))
printf("Testcase-1 Passed\n");
else
printf("Testcase-1 Failed\n");
// // Check createQueue Function
Queue*... |
C | /*
Nama Kelompok 2:
- Stephania Getrudis Inaconta Sadipun (2008561043)
- I Made Alit Darma Putra (2008561045)
- I Dewa Made Candra Wiguna Marcelino (2008561048)
- Maharani Putri Suari (2008561058)
Jurusan/Kelas : Informatika/C
Informasi Program:
... |
C | /// \file
/// A very simple unit test framework.
#pragma once
#include <signal.h>
#include <stdlib.h>
#include "util/log.h"
#include "util/util.h"
/// Exit if \p \_\_EXPR\_\_ evaluates to `false`.
#define CHECK(__EXPR__) \
do ... |
C | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "command.h"
#include "room.h"
// build the rooms and return spawn.
struct room* initRoom(const char name[21],const char env[21])
{
// init our test setup only
struct room *spawn = malloc(sizeof(struct room));
if(spawn == NULL)
... |
C | # include <stdio.h>
# include <stdlib.h>
int main(){
char c="c";
int i=1;
long l=1;
printf("&c: %p\n",&c);
printf("&c: %ul\n",&c);
printf("&i: %p\n",&i);
printf("&i: %ul\n",&i);
printf("&l: %p\n",&l);
printf("&l: %ul\n",&l);
char *cp=&c;
int *ip=&i;
long *lp=&l;
printf("cp: %p\n",cp);
p... |
C | //Name: Atharva Mainkar
//Group: Alex Jaziel Atharva
//Section: Lab 504/Lecture 004
//Problem: Project
//Date: 5/5/2020
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void topupBalance()
{
FILE *fp;
char playerName[100];
char name[20][100];
int i,x, money[20], gain[20], addMoney, a=0;
printf("P... |
C | /******************************************************************************************
*
* Filename: summa.c
* Purpose: A paritally implemented program for MSCS6060 HW. Students will complete
* the program by adding SUMMA implementation for matrix multiplication C = A * B.
* Assumptions: A, B, and C a... |
C | #define F_CPU 1000000 // Snelheid van de CPU, met dit kristal en deze waarde, is het precies 1 seconde
#include <avr/io.h> // Laadt de IO library, deze bevat de poorten
#include <util/delay.h> // // Laadt de Delay library, nu kan je een delay instellen
#include <stdio.h> // Laadt de stdio library, deze vat de meeste no... |
C | #include "matrix.h"
#include "nnopti.h"
#include "nnactiv.h"
#include "neural_network.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main() {
int index;
int layers[1] = {2};
struct Matrix input;
struct Matrix output;
struct NeuralNetwork nn;
nn = create_feedforward_nn(2, 1, 1, layers, &sigmo... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
//doplnte funkciu SignalHandler
void SignalHandler(int signal) {
printf("Received signal ID: %d\n",signal);
}
int main()
{
//vypis PID
printf("PID = %d\n", getpid());
//nastavenie signal handlera
struct sigac... |
C | /*
Author: Manohar Mukku
Date: 17.07.2018
Desc: GeeksforGeeks - Sudo Placement [1.2] - Beautiful pairs
Link: https://practice.geeksforgeeks.org/contest-problem/spp-beautiful-pairs/0/
*/
#include <stdio.h>
#include <stdlib.h>
int cmpfunc(const void* a, const void* b) {
return (*(int*)a) - (*(int*)b);
}
int main()... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "shared.h"
#include "hello_tx.h"
#include "interface.h"
#include "neighbor.h"
struct neighbor *alloc_neighbor(void)
{
struct neighbor *neighbor;
neighbor = xzalloc(sizeof(struct neighbor));
neighbor->state = NEIGHBOR_STATE_DO... |
C | #include <stdio.h>
#include <string.h>
char whitespace[] = " \n\r\f\t\v";
unsigned count_word(char *string, const char *word) {
unsigned count = 0;
char *buff;
// strtok with replace separator with NUL, the return the pointer to the
// string before separator.
// if the first parameter is NULL, strtok with... |
C | /**
*******************************************************************************
* File : oscode.h
* Description : Implementation of a simple shell
* Features : History of the last 10 commands,
background processes, list of jobs in background
... |
C | /* print the user name in 5 times */
#include <stdio.h>
void main()
{
char n[10];
int i=0;
printf("enter the name ");
scanf("%s",n);
while(5>i)
{
printf("%s \n",n);
i++;
}
} |
C | #include <stdio.h>
int main(void)
{
int x;
scanf("%d", &x);
if(x % 3 == 0)
{
printf("能被其中一个数(3)整除\n");
}
if(x % 5 == 0)
{
printf("能被其中一个数(5)整除\n");
}
if(x % 7 == 0)
{
printf("能被其中一个数(7)整除\n");
}
return 0;
}
|
C | #pragma once
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<errno.h>
#define MAX_NAME 10//ֵĴС
#define MAX_SEX 5//ԱС
#define MAX_TELE 15//绰С
#define MAX_ADDR 30//ַС
#define DEFAULT_SZ 3 //ͨѶ¼ĬϵĴС
enum Option
{
EXIT,
ADD,
DEL,
SEARCH,
MODIFY,
SHOW,
SORT,
SAVE,
CLEAR
};
struct PeoInfo
{
char ... |
C | /*
** Created by doom on 17/04/19.
*/
#ifndef CEEDS_MEMORY_ALLOCATOR_H
#define CEEDS_MEMORY_ALLOCATOR_H
#include <ceeds/core.h>
/**
* Memory allocator abstraction, used to build allocator-aware containers
*/
/**
* A handle to an allocator
*
* Allocator-aware objects should use such a handle in order to manage ... |
C | /*
* Copyright (c) 2021 Kevin Townsend (KTOWN)
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdlib.h>
#include <ctype.h>
#include <shell/shell.h>
#include <zsl/orientation/orientation.h>
#if CONFIG_ZSL_SHELL_ORIENT
static int
zsl_orient_shell_invalid_arg(const struct shell *shell, char *arg_name)
{
shel... |
C | #include "stdio.h"
#include "stm8s.h"
#include "uart.h"
int putchar (int c)
{
/* Write a character to the UART1 */
UART1_SendData8(c);
/* Loop until the end of transmission */
while (UART1_GetFlagStatus(UART1_FLAG_TXE) == RESET);
return (c);
}
/**
* @brief Retargets the C library scanf function to the USART... |
C | #include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "../../../libft.h"
void ft_print_result(char const *s, int n)
{
int i;
i = 0;
while (i < n)
{
write(1, &s[i], 1);
i++;
}
}
int main(int argc, const char *argv[])
{
char *str;
if (argc == 1)
return (0);
if (atoi(argv[1]) == 1)
{
... |
C | #include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
//DEKLARASI PROSEDUR//
void Input_Data(int item[], int jum);
void Tampil_Data(int item[], int jum);
void Urutan_Profit(int *no, float *weight, float *profit, int *pieces, int c);
void Urutan_Density(int *no, float *weight, float *profit, in... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
struct juego{ // DEFINIR LAS ESTRUCTURAS EN LAS MATRICES PARA QUE SE PUEDAN COLOCAR TODOS LOS DATOS ""
char cobertura;
char simbominas;
int numminas;
int nummarco;
int ganador;
};
typedef struct juego tipoCasilla; //... |
C | #include <stdio.h>
#include "load_avg.h"
#include <memory.h>
#include <stdlib.h>
bool is_open = false;
FILE *load_file;
bool open_load_avg_file() {
load_file = fopen("/proc/loadavg", "r");
is_open = (load_file != NULL);
return is_open;
}
void close_load_avg_file() {
if (is_open) {
fclose(load... |
C | #include<stdio.h>
#include<stdlib.h>
#include<conio.h>
#include<string.h>
struct Nguoi{
char hoTen[50];
int namSinh;
};
struct CGP{
struct Nguoi duLieu;
struct CGP *trai, *phai;
};
struct CGP* taoNut(struct Nguoi ng, struct CGP *tr, struct CGP *ph)
{
struct CGP *p;
p = (struct CGP*) malloc(sizeof(struct CGP))... |
C | #include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include "tcp.h"
#include <stdlib.h>
#include <fcntl.h>
int Sockfd;
void
CloseServer()
{
close(Sockfd);
printf("\nTCP Server exit.....\n");
exit(0);
}
main(int argc, char *argv[])
... |
C | #include <stdio.h>
void main(){
int num,down,a,b,c;
printf("һλ:");
scanf("%d",&num);
a = num%10;
b = num/10%10;
c = num/100;
down = 100*a+b*10+c;
printf("%d->%d\n",num,down);
}
|
C | #include<stdio.h>
main()
{
int i,temp,n;
printf("Enter the range");
scanf("%d",&n);
int arr[n];
printf("Enter the elements");
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<n-1;i++)
{
if(i%2==0)
{
temp=arr[i];
arr[i]=arr[i+1];
arr[i+1]=temp;
i++;
}
}
for(i=0;i<n;i++)
{
printf("%d\t",arr[i]);... |
C | /**
* @file Line.h
* @author C. Barnson (cbarnson@outlook.com)
* @brief Represents a straight line in 2D.
* @version 0.1
* @date 2019-01-11
*
* @copyright Copyright (c) 2019
*
*/
#ifndef _LINE
#define _LINE
#include <cmath>
#include "Point.h"
const float PI = 3.14159265;
/**
* @struct ... |
C | #ifndef TL_PAIRING_HEAP
#define TL_PAIRING_HEAP
#include "config.h"
#include "cstdint.h"
#include <stddef.h>
typedef struct tl_ph_node {
struct tl_ph_node *left_child, **prev_next, *right_sibling;
} tl_ph_node;
typedef struct tl_pairing_heap {
tl_ph_node* root;
} tl_pairing_heap;
extern tl_ph_node tl_ph_null;
TL... |
C | /* Prototyper */
/* Funktion til at skippe input i inputbufferen, hvis der er input, der ikke blev læst.
* Funktionen har ikke nogen input parametre.
* Returnerer ikke noget.
*/
void clear_input(void);
/* Funktion til at printe én enkelt opgave.
* task1: Input parameter af typen task. Denne opgave printes.
* Ret... |
C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(int argc, char const *argv[])
{
int N;
int count;
int pow=1;
printf("Saraが食べたいビスケットの数は?\n");
scanf("%d",&N);
while(N>pow){
pow*=2;
count++;
}
printf("%d\n",count);
return 0;
}
|
C | #include "push_swap.h"
void do_pa(t_stacks *stacks, int flag)
{
t_stack *tmp;
t_stack *new;
if (!stacks->size_b)
return ;
tmp = stacks->stack_b;
stacks->size_a++;
new = new_list(stacks->stack_b->num, stacks->stack_b->index);
if (!new)
exit(1);
list_add_front(&stacks->stack_a, new);
stacks->stack_b = stac... |
C | /**************************************************************
1119번
nayeonvita
C
정확한 풀이코드 길이:113 byte(s)
수행 시간:0 ms
메모리 :1120 kb
****************************************************************/
#include <stdio.h>
int main (void)
{
int a;
scanf ("%d", &a);
printf ("%d", a*24);
return 0;
}
|
C | #define _CRT_SECURE_NO_DEPRECATE
#include<stdio.h>
int judge1(int x) {//ж϶1ĸΪʱ
int cout = 0;
while (x > 1)
{
if (x % 2 == 1)
cout++;
x /= 2;
}
if (x == 1) {
cout++;
}
return cout;
}
int judge2(int x) {//xһλжDz1ǵĻcout++Ȼxһλжһλܹж32
int cout = 0;
for (int i = 0; i < 32; i++) {
if (x & 1 == 1)
cout++... |
C | #include "context_switch.h"
/** Kernel Context Kernel Stack Initialization:
* PCBToInit: PCB whose Kernel stack needs to be initialized
* nextPCB: Placeholder
* note: does not switch to nextPCB
*/
KernelContext *KCKSInit(KernelContext * kc, void *PCBToInit, void *nextPCB) {
char *indent = "KCKSInit:";
TracePr... |
C | #include "holberton.h"
#include <stdio.h>
/**
* binary_to_uint - converts a binary number to an unsigned int
*@b: number as a string
*
* Return: unsigned int
*/
unsigned int binary_to_uint(const char *b)
{
unsigned int num = 0;
int index;
int binlen;
if (b == NULL)
return (0);
binlen = getBinLen(b);
if (... |
C | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
/*
Gesto Escolar
@author Thiago Silva Campos
*/
int main(int argc, char *argv[]) {
setlocale(LC_ALL,"Portuguese");
printf("Gesto escolar\n");
char aluno[30]
char sexo = 'm/f';
int idade;
printf("Aluno: %s\n",aluno);
printf("Sexo: ")... |
C | #include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <zmq.h>
#include "message.h"
void usage_user(){
printf("enter:\n");
printf("1) to insert money\n");
printf("2) to get money\n");
printf("3) to transfer money to another client\n");
printf("4) to show ... |
C | #include "binary_trees.h"
/**
* calc_height_diff - gets the difference in tree height
* @left: left side of tree
* @right: right side of tree
* Return: difference in height
*/
int calc_height_diff(int left, int right)
{
if (right > left)
return (right - left);
else
return (left - right);
}
/**
* get_tree_... |
C | #ifndef _RTAMBXLINKH_
#define _RTAMBXLINKH_
extern "C"
{
int FunctionOne(); //Setup - Returns NULL if OK
int FunctionTwo(char* script); //Send Script - A standard amBX script as a char*. Returns NULL if OK
int FunctionThree(); //Shutdown - Returns NULL if OK
char* FunctionFour(); //GetV... |
C | #include <stdio.h>
int main()
{
int a;
int* ptrtoa;
ptrtoa = &a;
a = 5;
printf("The value of a is %d\n", a);
*ptrtoa = 6;
printf("The value of a is %d\n", a);
printf("The value of ptrtoa is %d\n", ptrtoa);
printf("It stores the value %d\n", *ptrtoa);
printf("The address of a is %d\n", &a);
... |
C | // 3.3 Swap two adjacent elements by adjusting only the pointers (and not the data),
// using a. single linked list, b. double linked list.
#include "list.h"
#include "logging.h"
#include "utils.h"
DEFINE_LIST_TYPE(IntList, int, value);
DEFINE_DOUBLE_LIST_TYPE(IntDoubleList, int, value);
void checkIntList(IntList* l... |
C | //Trecho de código em Linguagem C, responsável pelo Insercion Sort
void insertionSort(int V[], int tam)
{
int i, j, aux;
for(i = 1; i > tam; i++){
j = i;
while((j != 0) && (V[j] > V[j - 1])) {
aux = V[j];
V[j] = V[j - 1];
V[j - 1] = aux;
j--;
}
... |
C | /* author: Jonathan P.
last update: 03-09-2013
Description: memory game based on determining direction of led movement
Hardware setup:
PORTC connected to 8 LEDs
Buttons connected to RA4, RA5
*/
//--------------------------Initialization------------------------------------------
#include <pic.h> //include a libr... |
C | /*====================================================================*
*
* char const * codename (struct _code_ const list [], size_t size, code_t code, char const * name);
*
* symbol.h
*
* return the name associated with a given code by searching a name
* list arranged in ascending order by code; ret... |
C | #include<stdio.h>
int main()
{
double s=0,t=1,k=1;
printf("请输入一个数n:");
int n;
scanf("%d,",&n);
for(k=1;k<=n;k=k+1)
{
t=t*k;
s=s+t;
}
printf("1!+2!+...+n!=%22.15e\n",s);
return 0;
}
|
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* process_arg_sf.c .:: .:/ . .:: ... |
C | #ifndef DP_DECODE_UDP_H
#define DP_DECODE_UDP_H
#define UDP_GET_LEN(p) UDP_GET_RAW_LEN(p->udph)
#define UDP_GET_SRC_PORT(p) UDP_GET_RAW_SRC_PORT(p->udph)
#define UDP_GET_DST_PORT(p) UDP_GET_RAW_DST_PORT(p->udph)
#define UDP_GET_SUM(p) UDP_GE... |
C | //
// Created by YDiamond on 03.11.2020.
//
#include <stdio.h>
#include <malloc.h>
#include "linkedList.h"
llist_node* llist_create(int number){
llist_node *tmp = malloc(sizeof(llist_node));
tmp->prev = NULL;
tmp->value = number;
tmp->next = NULL;
return tmp;
}
... |
C | #include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "libft.h"
#include <stdio.h>
#include <ctype.h>
static void check_tolower(int start, int end)
{
int c;
while (start <= end)
{
c = ft_tolower(start);
write(1, &c, 1);
start++;
}
}
static void check_tol... |
C | // newton raphson
// floating point support
// support for math function fabs
int printf(char s[20],float a);
int printf1(char s[20],float a,float b,float c,float d);
int printf2(char s[20],int b);
float fabs(float a);
// x^3-x^2+2
float func(float x){
return x*x*x - x*x + 2;
}
float deriv(float x){
return 3*... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pixel_colors.c :+: :+: :+: ... |
C | #include<stdio.h>
#include<string.h>
#define N strlen(g)
char t[128],cs[128],g[] = "10001000000100001";
int a,e,c;
void xor()
{
for(c=1;c<N;c++)
cs[c] = ((cs[c] == g[c])?'0':'1');
}
void crc()
{
for(e=0;e<N;e++) cs[e] = t[e];
do
{
if(cs[0] == '1')xor();
for(c=0;c<N-1;c++) cs[c] = cs[c+1];
cs[c] = t[e++];
... |
C | #include "elenco.h"
void elenco_HardcodeElenco(eElenco* listE,int lenElenco)
{
int i;
int codActor[]= {0,12,14,2,5,17,19,8,9,12};
float valorContrato[]= {30000,2000,500000,9000,20000,10000,30000,2000,500000,9000};
int codPelicula[]= {12,10,12,7,8,4,10,8,4,7};
for(i=0; i<lenElenco; i++)
{
... |
C | /***************************************************************************
util.c - description
-------------------
begin : Fri Sep 26 2003
copyright : (C) 2003 by Hiroyuki Kuwahara
email : kuwahara@cs.utah.e... |
C | /**
* 作者:chenda
* 时间:2019/7/10:13:26
* 邮箱:
* 说明:
*/
#ifndef CORENOTE_DULLINKLIST_H
#define CORENOTE_DULLINKLIST_H
//泛型循环双链表,带头节点,节点下标从0开始,头节点不计入下标值
typedef struct node{
void *data; //数据域指针
struct node *pre;
struct node *next;
}Node;
struct list{
struct node *head;
int data_size; //数据域所... |
C | #include <stdint.h>
#include <string.h>
#include "qc/error.h"
#include "qc/random.h"
#include "qc/tests.h"
int main(void) {
qc_rnd rnd;
qc_err* err = qc_err_new();
qc_assert(qc_rnd_init(&rnd, err) == QC_SUCCESS, "qc_rnd_init has failed: %s", qc_err_get(err));
qc_err_free(err);
uint8_t buf[32] = {0}... |
C | #include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
/* Faca um programa que leia um vetor com dados de 5 livros: tıtulo (maximo 30 letras), autor (maximo 15 letras) e ano. Procure um livro por tıtulo,
perguntando ao usuario qual tıtulo deseja buscar. Mostre os dados de todos os livros... |
C | #include <stdio.h>
int main(void) {
int i;
char arr[10] = {0, };
for(i = 0; i < 10; i++) {
if(arr[i] == 0) printf("null ");
else printf("%d ", arr[i]);
}
printf("\n");
return 0;
}
|
C | #include <sys/types.h> /* basic system data types */
#include <sys/socket.h> /* basic socket definitions */
#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
#include <arpa/inet.h> /* inet(3) functions */
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <signal.h>
#include ... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 2-0-inter3.c :+: :+: :+: ... |
C | struct obj_test_t
{
int val;
char* name;
size_t len;
};
/* constructor */
int obj_test_Ctor(struct obj_test_t** obj, const char* name, size_t len, int val);
/* destructor */
void obj_test_Dtor(struct obj_test_t** obj);
/* getters */
char* obj_test_get_name(struct obj_test_t* obj);
int obj_test_get_val(struct obj_... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* redir_struct_utils.c :+: :+: :+: ... |
C | /** sebu petrik
* prikald vystupu
*
* [50%] Building C object CMakeFiles/slova.dir/slova.c.o
[100%] Linking C executable slova
[100%] Built target slova
Kededi jinedu ki hawi volebi.Fi dedu lasusi bepomi womewe he nu.
Dukeve niwozu topepe pu caki hicuhu ca site.Le duju wine zavefu jefomo na wido.
... |
C | #include <stdio.h>
int main(void)
{
int m, d, y, mm, md, my;
printf("Enter a date (mm/dd/yy): ");
scanf("%d/%d/%d", &mm, &md, &my);
while (1){
if (mm==0 && md==0 && my==0) break;
printf("Enter a date (mm/dd/yy): ");
scanf("%d/%d/%d", &m, &d, &y);
if (m==0 && d==0 && y==0) break;
else if... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "HDDsimugrad.netid.h"
int main ()
{
//createtherequests
int requests[];
requests = createRequests();
for (int i = 0; i < NUM_REQUESTS; ++i) {
addToQueue(requests[i]);
}
//servicetherequests
int r;
r = getNextRe... |
C | #include <include.h>
static bool playerCheck(char color) {
// Horizontal check
for (int y = 0; y < size; y++) {
int count = 0;
for (int x = 0; x < size; x++)
if (fields[y * size + x] == color) {
if (count < winReq)
trace[count] = (Pos) {
... |
C | #include "threadlist.h"
extern ptrListaThread listaThread;
extern HANDLE listMutex;
void imprimeLista(ptrListaThread ptr)
{
if (ptr == NULL)
printf("(Vacia)\r\n\r\n");
else
{
printf("La lista es:\r\n");
while (ptr != NULL)
{
printf("Request %d -> ", ptr->info.socket);
ptr = ... |
C | /*
* This file defines and implements the Global descriptor tables.
*/
#include <ganoid/types.h>
#include <string.h>
#include <gdt.h>
#include <kernel.h>
#include <timer.h>
void gdt_flush(void);
// allocate space for the GDT
struct segment_descriptor GDT[DEFAULT_GDT_SIZE] __attribute__ ((aligned(8)));
struct GDT... |
C | #include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
int gcd(int a, int b)
{
int g,i;
for(i=1; i <= a && i <= b; ++i)
{
if(a%i==0 && b%i==0)
g = i;
}
return g;
}
void main()
{
int p,q,N,Q,e,d;
printf("Enter the value of first pr... |
C | //#include <avr/io.h>
//#include <avr/interrupt.h>
//#include <stdlib.h>
//#define PUFFER_GROESSE 50 //Puffergre in Byte
#include "uart.h"
unsigned char puffer[PUFFER_GROESSE];
unsigned char* lesezeiger;
unsigned char* schreibzeiger;
FILE uart_stdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);
//==... |
C | #include "stack_linked_list.h"
Node* push_front(Node* node, const int data) {
Node* new_node = malloc(sizeof(Node));
new_node->data = data;
new_node->next = node;
return new_node;
}
Node* pop_front(Node* node, int* data) {
*data = node->data;
Node* next_node = node->next;
free(node);
return next_node;
}
void... |
C | //Write a program to display the class according to
//marks scored by students. The marks scored is taken
//as input and class is displayed according to the range :
//70-100 Distinction(A)
//60-69 First Class(B)
//50-59 Second Class(C)
//40-49 Pass Class(D)
//0-39 Fail(F)
//Subjects are :
/... |
C | #include <stdio.h>
#include <cs50.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
int main(int argc, string argv[])
{
if (argc != 2)
{
printf("Usage: ./vigenere k");
return 1;
}
string key = argv[1];
int len_key = strlen(key);
for(int i = 0; i < len_key; i++)
... |
C | #include <stdio.h>
#include <malloc.h>
#include <string.h>
#define MAX_LENGTH 200
int main()
{
char* input;
input = malloc(MAX_LENGTH);
printf("Please enter your string");
scanf("%[^\n]", input);
for(int i=strlen(input);i>=0;i--)
printf("%c", input[i]);
printf("\n");
free(input);... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* print_f.c :+: :+: :+: ... |
C | /*
Eratosthenes sieve -- method of finding the prime numbers.
This example shows loops and conditions work correctly.
*/
#include <stdio.h>
#include <stdlib.h>
typedef unsigned long UL;
int main() {
#ifdef JUDGE
UL n = 10000;
#else
UL n;
scanf("%lu", &n);
#endif
char *p = malloc(n + 1);... |
C | #include <stdlib.h>
char* duplicate(char* letters, int* digits) //Dubles letters by the number that is in the corsponding cell in digits
{
int size = 1, i, j;
char* str_res = (char*)malloc(1 * sizeof(char)); //Creates a one cell char
int lenLet = strlen(letters);
for (i = 0... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <allegro5/allegro_native_dialog.h>
#include "baralho.h"
#include "jogo.h"
#include "save.h"
void writeToLog(char *str) {
FILE *logfile = fopen(LOG_FILE, "a");
if(!logfile) return;
fprintf(logfile, "* %s\n", str);
fclo... |
C | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
/**** Lista de Exercícios - Funções e Ponteiros em C */
//...
/**TODO: Escreva os cabeçalhos (protótipos) das funcoeses aqui **/
void incrementa(int *n, int num);
void swap(int *a, int *b);
void calc(int x, int y, int *soma);
int eqSegundoGrau(float a, float b, ... |
C | #include <stdio.h>
/**
Macro used to define a command ID based on the service ID and
function number.
*/
#define TZ_SYSCALL_CREATE_CMD_ID(s, f) \
((int)(((s & 0x3ff) << 10) | (f & 0x3ff)))
#define tzt_fastcall_tz3(xxid) \
((int)((xxid << 12) | 3))
int createSysCall()
{
int s = 0x1;
... |
C | #include "calc.h"
#include <stdio.h>
#define FLAG_1 0x1
#define FLAG_2 0x2
#define FLAG_3 0x4
int is_flag_on (struct calc *c, int flag);
int set_flag (struct calc *c, int flag, int on);
#define assert_equal(first, second) \
if (first == second) ... |
C | #include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <openssl/pem.h>
#include <openssl/rsa.h>
#include <openssl/err.h>
#define ID_EN_FILE_PATH "/home/lele/Template/id_en_file"
#define USR_PRV_PATH "/home/lele/Template/usr_prv.key"
#define MFR_PRV_PATH "/home/lele/Template/mfr_prv.key... |
C | #include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/file.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <signal.h>
#include <fcntl.h>
#include "../libpfs/pfs.h"
#include "../pfsd/pfsd.h"
int
pfsd_bootstrap (const char * root_path)
{
char * lo... |
C | /*
* myMath_matrix3.c
*
* Created on: Aug 20, 2013
* Author: Jure
*/
#include "stm32f4xx.h"
#include "arm_math.h"
#include "allinclude.h"
#include "myMath_typedefs.h"
#include "myMath.h"
#include "myMath_vec3.h"
#include "myMath_matrix3.h"
// Create and initialize new 3x3 matrix
// if identity == 0, init m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.