language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include<stdio.h>
int main()
{
int P,T;
float R,simple_interest;
printf("Enter the value of P,R,T: ");
scanf("%d%d%f",&P,&T,&R);
simple_interest = P*T*R/100;
printf("The value of simple interest is %f ",simple_interest);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
int main() {
float i =0.0,j=0.0;
while(1){
if(scanf("%f %f",&i,&j) !=2)
break;
printf("MEDIA = %0.5f\n",((i*3.5)+(j*7.5))/11);
}
return 0;
} |
C | #include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
if (chdir("/") < 0 && errno == ENXIO)
exit(EXIT_SUCCESS);
fprintf(stderr, "got errno=%m\n");
exit(EXIT_FAILURE);
}
|
C | /*****************************************************************************
|*
|* Copyright: Copyright (c) 2009, Altium
|*
|* Description: pthread_attr_getname
|*
\*****************************************************************************/
#include <string.h>
#include <pthread.h>
#include <errno.h>
#in... |
C | typedef struct io_interface_node{
io_interface current;
struct io_interface_node *next;
} io_interface_node;
typedef struct {
io_interface_node *head;
io_interface_node *tail;
} io_interface_queue;
int enqueue(io_interface_queue *queue, io_interface_node *node) {
if (queue->head == NULL) {
... |
C | #include <stdio.h>
char farm[10][10];
int main(void) {
int i, j;
int barn_x, barn_y, obstacle_x, obstacle_y, water_x, water_y;
int pig_number=0;
for (i=0; i<10; i++){
for (j=0; j<10; j++){
farm[i][j]='.';
}
}
printf("Enter the X and Y values of the barn(B):\n");
scanf("%d%d",&i,&j);
farm[i-1]... |
C | /*
* Implementation of the word_count interface using Pintos lists.
*
* You may modify this file, and are expected to modify it.
*/
/*
* Copyright © 2019 University of California, Berkeley
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, I... |
C | /*
* 使用TLS,测试多线程效率
* gcc -g 4_pthread_key.c -pthread -openmp 测试并行模式下程序的执行时间
*/
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <omp.h>
#include <sys/time.h>
pthread_key_t key;
#define THREAD_NUM 50
void *thread()
{
long i = 0;
pthread_setspecific(key, &i);
struct timeval start, e... |
C | #include<stdio.h>
void f(char* c, char d){
*c = *c + 1;
d = d + 1;
printf("%d %d",c,d);
}
int main(){
char a = 'A', b = 'a';
f(&b, a);
printf("%d %d", a, b);
system("pause");
return 0;
} |
C | /*
*
* getint.c
*
* Ramiro Jordan
* ECE 231 - Spring 2012
* Date: January 16, 2012
*
*/
/* Does what ?????? */
/* driver program */
#include <stdio.h>
#define STOP -1
#define NONUM 1
#define YESNUM 0
void main()
{
int num, status;
(void) printf ("\nThis program stops reading ... |
C | /*
check50 2015.fall.pset1.water water.c
*/
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int n = 0;
int btls = 0;
printf("\nWater!\n\n");
printf("minutes: ");
n = GetInt();
btls = 192/16 * n;
printf("bottle: %i\n", btls);
}
|
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "numberOfLinesLib.h"
int numberOfLines(const int LINESIZE, const char *FNANAME) {
FILE *fnaPointer;
char singleCharLine[256];
fnaPointer = fopen(FNANAME, "r");
if(fnaPointer == NULL) {
printf("%s", "Error: fnaPointer is null\n"... |
C | #include <stdio.h>
#include <string.h>
#include "redis_hash_commands.h"
#include "redis_connect.h"
#include "redis_io.h"
int main()
{
return_code status;
if((status = redis_connect("127.0.0.1", "6379")) == SUCCESS)
printf("Connected.\n");
else
{
printf("Connection failed.\n");
return 1;
}
i... |
C | #pragma once
#ifdef _MSC_VER
#if (_MSC_VER <= MSVC_2003 )
#ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED
typedef int errno_t;
#endif
inline int_x memcpy_s(void * pDst, int_x iSize, const void * pSrc, int_x iCount)
{
iSize = Min(iSize, iCount);
memcpy(pDst, pSrc, iSize);
return iSize;
}
inline int_x memmove_s(... |
C | #include<stdio.h>
#include<math.h>
double PI=3.1415926;
double eps=1e-9;
double x, y,l,d;
double cal(double i)
{
return -(x-l*sin(i)-d/cos(i))/tan(i);
}
int fun()
{ double i, left=0, right=PI/2, lmid, rmid;
while(fabs(right-left)<eps){
lmid=(2.0*left+right)/3;
rmid=(left+2.0*right)/3;
if(cal(lmid)... |
C | #include "blockchain/transaction.h"
void write_transactiondata(TransactionData *transaction, int fd)
{
write(fd, &transaction->magic, sizeof(char));
write(fd, &transaction->type, sizeof(char));
BIO *pubkey = BIO_new(BIO_s_mem());
PEM_write_bio_RSAPublicKey(pubkey, transaction->sender_public_key);
... |
C | #ifndef TERMCOLOR_H
#define TERMCOLOR_H
#include <stddef.h>
typedef struct {
unsigned char r;
unsigned char g;
unsigned char b;
} termcolor;
/* sets the terminal based on name, if name is NULL then the
name is taken from the TERM environment variable. */
extern void termcolor_setup (const char * term);
/* ... |
C | #include<stdio.h>
void quicksort(int numar[20], int primul, int ultimul) {
int i, j, pivot, aux;
if (primul < ultimul) {
pivot = primul;
i = primul;
j = ultimul;
while (i < j) {
while (numar[i] <= numar[pivot] && i < ultimul)
i++;
while (numar[j] > numar[pivot])
j--;
if (i < j... |
C | // Lab de teste e configuracao do estimador de atitude do Drone
#include "mbed.h"
#include "crazyflie.h"
#include "USBSerial.h"
//Define serial object
USBSerial serial;
//Define serial command variable
char command;
//Define attitude estimator object
AttitudeEstimador estimador;
//Define Ticker object
Ticker tic;
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
//Inicio da declaração das structs
typedef struct data{
double turnaroundTime;
double averageServiceTime;
double CpuUsage;
double averageResponseTime;
double throughput;
double averageWaiti... |
C | #include <stdio.h>
void fun(void)
{
printf("fun() called from a static library");
}
int add_number(int x, int y) {
return x+y;
} |
C | #include <stdio.h>
void shellsort(int v[], int n);
void shellsort1(int v[], int n);
void shellsort2(int v[], int n);
void main()
{
int v[23] = {263,4,3,352,28,2,55,20,100,87,348,32,211,1,34,12,23,22,19,102,8,90,49};
int i;
shellsort(v,23);
for(i = 0; i < 23; ++i)
printf("a[%d]=%d ",i, v[i]);
printf("\n");
... |
C | //To Check The ith bit is set or not
#include<stdio.h>
int main()
{ int t,n,f,i,res;
f=1;
printf("enter the no. of testcases\n");
scanf("%d",&t);
while(t--)
{ printf("\nenter the no. and its ith bit\n");
scanf("%d%d",&n,&i);
f=f<<i;
res=n&f;
if(res==0)
{ printf("\nTRUE\n");
}
else
... |
C | #ifndef NET_EXPERIMENT_H
#define NET_EXPERIMENT_H
/****************************************************************************
* a net experiment consist of these steps
* 1. make sure the size of the net [n]
* <after_net_size>
* 2. make sure the topo of the net [epsilon]
* <after_net_connect>
* 3. make sure the... |
C | #include <stdio.h>
#include <stdlib.h>
#include <signal.h>
void SIGhandler(int); /* SIGUSR1 handler */
void sig_handler(int);
void SIGhandler(int sig)
{
printf("\nReceived a SIGUSR1. \n" );
exit(0);
}
void sig_handler(int sig)
{
printf("\nReceived a SIGUSR2. \n" );
e... |
C | /*
public class ListNode {
public int val;
public ListNode next;
public ListNode(int val=0, ListNode next=null) {
this.val = val;
this.next = next;
}
}
*/
public class Solution {
public ListNode AddTwoNumbers(ListNode l1, ListNode l2) {
ListNode head = new List... |
C | #include<stdio.h>
#include<string.h>
void main()
{
char plain_text[20],cipher1[20],cipher2[10][10];
int key1,key2,no_r,start,i,j,n;
printf("\nenter the plain text");
scanf("%s",plain_text);
printf("\nenter the key for caesar");
scanf("%d",&key1);
for(i=0;i<strlen(plain_text);i++)
cipher1[i] = plain_text[i]+ke... |
C | #include <stdio.h>
void main() {
int a = 10;
int *pa; // //ּ ڷ
pa = &a; //=&;
printf("a=%d\n", a);
printf("*pa%d\n", *pa); //, ּҷ
printf("&a=%p\n", &a);
printf("&pa=%p\n", &pa);//ͺ pa ּ
printf("&pa=%p\n", pa);//ͺ pa =a ּ
printf("&*pa=%p\n", &*pa); //ͺ pa (*) ּ(&)
} |
C | #include <stdio.h>
#include <conio.h>
#define N 5
void main()
{
int arr[N];
int i,j,max=-9999,min=9999,sum=0;
clrscr();
for(j=0;j<N;j++)
{
printf("Enter element %d in the array",j+1);
scanf("%d",&arr[j]);
}
for(i=0;i<N;i++)
{
if(arr[i]>max)
max=arr[i];
if(arr[i]<min)
min=arr[i];
... |
C | /* The malloc Function */
// The malloc() function allocates a specified number of contiguous bytes in memory.
#include <stdio.h>
#include <stdlib.h> // includes memory management functions.
#include <locale.h>
int main() {
setlocale(LC_ALL, "Portuguese");
int *ptr;
// malloc returns a pointer to the allocat... |
C | #include<stdio.h>
long triangleSum(long n)
{
int sum=(n*(n+1))/2;
return sum;
}
long checkDivisors(long n)
{
long exponent=1, count=0, i;
for(i=2; i<=n; i++, count=0)
{
if(n%i==0)
{
while(n%i==0)
{
n=n/i;
count++;
}... |
C | // Michael Bamesberger
// CS344 Program 4
// otp_dec connects to otp_dec_d, asks to decrypt cipher
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
void keyHandler(int sockfd, ch... |
C | #include <stdio.h>
int main()
{
int n;
float i=2, har=1;
printf("Ingrese un numero: ");
scanf("%d", &n);
while(i<=n){
har=har + 1/i;
++i;
}
printf("El %dth numero armonico es: %.3f\n", n, har);
return 0;
} |
C | #include <stdio.h>
int main(void) {
FILE *fp;
fp = fopen("test.txt", "w");
fprintf(fp, "This string is written by the program.");
fclose(fp);
return 0;
}
|
C | #include <minix/syslib.h>
#include <minix/drivers.h>
#include <minix/sysutil.h>
#include "SerialPortClass.h"
#define SP_DEBUG 0
struct serial_port_class
{
unsigned short baseAddr;
char lcr;
char lsr;
char ier;
char iir;
bool transmitter;
};
/////////////////////////////// PUBLIC /////////////////////////////... |
C | //#include "stm32f2xx.h"
#include "ff.h"
#include "fatfs_usr.h"
FATFS FS; //ļϵͳṹ
FIL fsr,fsw; //ļṹ
//FILINFO fileinfo;//ļϢ
//DIR dir; //Ŀ¼
FRESULT FAT_flag;//ļķ
#if 0
/*******************************************************************************
* : getfree
* : -õʣ
* : -drv :̱("0:"/"1:")
* ... |
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* path_x2.c .:: .:/ . .:: ... |
C | #include <stdio.h>
#include <stdlib.h>
/* given any date, give the day of the week
date can be in form of
day month year
Later, add ability to parse other date formats
and things like now, today, etc.
This generic date converter will be useful for many things.
year 1900 has an offset ... |
C | #ifndef SUPORTEESCRITABIBLIOTECA_H
#define SUPORTEESCRITABIBLIOTECA_H
void escrever_ordem_casas()
{
int matriz_location[TAMANHO_MATRIZ_JOGO][TAMANHO_MATRIZ_JOGO],
ponteiro_matriz = 0;
for (int linha = 0; linha < TAMANHO_MATRIZ_JOGO; linha++)
for (int coluna = 0; coluna < TAMANHO_MATRIZ_JOGO; coluna++)
{
po... |
C | /*
Name: Vernon Meighan
Date: 20200107
Project: This program will complete the following:
#Student ages
-Declare and zeroize an int array with a dimension equal to the number of students + 1
-Set index 0 with the age* of the instructor
-Fill the elements of the array with the ages* of the students starting with index 1... |
C | #include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "rsa.h"
#define RSA_S (100) //Number of Miller-Rabin's tests
void rsa_generate_keys(struct rsa_key**, struct rsa_key**);
unsigned long rsa_convert(unsigned long, struct rsa_key*);
unsigned short rsa_get_prime();
void rsa_get_keys(unsigned long*, unsig... |
C | ////////////////////////////////////////////////////////////////////
//
// Name - Akshay Bhagwat
// City - Pune (Maharashtra)
// Email - akshay.bhagwat1003@gmail.com
//
///////////////////////////////////////////////////////////////////
#include<stdio.h>
#include<stdlib.h>
void LCM(int *ptr,int size)
{
int i = 0,j... |
C | /* Filename: Stack.c */
/* */
/* EXPORT: Procedure Push: Put a search tree node onto the stack */
/* Procedure Pop: Delete a search tree node from the stack ... |
C | /*
* input.c
* irtouchd input function
*
* Created by David Keller on 09/11/08.
* Copyright 2008 EFREI. All rights reserved.
*
*/
#include <stdlib.h>
#include <assert.h>
#include <signal.h>
#include <pthread.h>
#include <string.h>
#include <errno.h>
#include <peach.h>
#include <multitouch.h>
struct _inpu... |
C | #include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
typedef struct _stdobject_{
va_list args;
void* morph;
va_list _arguments(int n_args){
va_list this;
va_start(this, n_args);
return this;
}
void _end_arg(va_list a){
va_end(a);
return;
}
void*... |
C | #include <stdio.h>
#include "alloc.h"
#define ALLOCSIZE 10000
static char allocbuf[ALLOCSIZE];
static char *allocp = allocbuf;
char *alloc(int size)
{
if (allocbuf + ALLOCSIZE - allocp > size) {
allocp += size;
return allocp - size;
} else
return 0;
}
void freeit(char *p)
{
if (p... |
C | //
// Ex1_Task2.c
// Infor2_Exercise
//
// Created by 谭特 on 17/2/24.
// Copyright © 2017年 谭特. All rights reserved.
//
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#define MAX 256
int main() {
int A[MAX];
int num=0, index = 0, size =0;
int sum = 0;
double average;
//read user input b... |
C | #include<stdio.h>
int n=10;
int swap(int i,int min,int a[n])
{
int temp = a[i];
a[i] = a[min];
a[min] = temp;
}
int heapify(int a[10],int i)
{
int l = (2*i)+1;
int r = (2*i)+2;
int min =-1;
if(n>r)
{
if(a[l]>=a[r])
{
min = r;
}
else
... |
C | #include "head.h"
typedef struct matrizPNG{
int height;
int width;
int** image;
} MatrizPNG;
//Entrada: fileName <tipo: char*> (nombre del archivo a leer)
//Lee una imagen .png
MatrizPNG* readImage(char* fileName) {
png_structp pngPtr;
png_infop infoPtr;
FILE* filePtr;
png_uint_32 width;
pn... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct cell_f{
char *main_title;
char *sub_title;
char *date;
char *path;
int category;
struct cell_f *next;
};
struct cell_c{
int number;
char *category;
struct cell_c *next;
};
#define MAXLEN 100
#define MAX 2000
void insert_cell_f(struc... |
C | #include <stdio.h>
#include <SDL2/SDL.h>
#include <string.h>
void _copystr(int nStartIndex, int nEndIndex, char src[], char dst[])
{
int count = 0;
for(count = 0; nStartIndex < nEndIndex; count++, nStartIndex++)
{
dst[count] = src[nStartIndex];
}
dst[count] = 0;
printf("%s\n", dst);
}
... |
C | #include <arpa/inet.h>
#include <errno.h>
#include <netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include "openssl/crypto.h"
#include "openssl/err.h"
#include "openssl/ssl.h"
// To compile and run
// gcc... |
C | #include <stdio.h>
#include <stdlib.h>
extern char **environ;
int func(int arg)
{
printf("in func arg=%d\n", arg);
return (arg);
}
void exit_func(void)
{
printf("exit_func\n");
}
int main(int argc, char **argv)
{
int i = 2;
printf("in main\n");
i = func(i);
printf("func return %d add\n",... |
C | /*
* Date: 12/12/2015
* Writter: Loc Pham
* Description: This file contains function declarations for CMD
*/
#ifndef _CMD_H
#define _CMD_H
// Include header files
#include "stm32f4xx.h"
// Declare macros
// Declare structs
// Declare function prototypes
/*
* Name: CMD_IsValid
* Module: cmd
* Parameters: cmd... |
C | #include <stdio.h>
#include <string.h>
#define MAX 1010
#define debug 0
int is_font_valid(int font, int W, int H, char *str)
{
int i, j, no_of_words;
// Find the total no of words in str
no_of_words = 1;
for (i=0; i < strlen(str); i++)
if (str[i] == ' ')
no_o... |
C | #include "TAD_Palavra.h"
void inicializaPalavra(TPalavra *palavra)
{
palavra->Primeiro = INICIO;
palavra->Ultimo = palavra->Primeiro;
palavra->tamanho = 0;
}
void insereLetra(TPalavra *palavra, TLetra letra)
{
if (palavra->Ultimo > MAX_TAM_PALAVRA)
return; //lista cheia
else
{
... |
C | #include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include "termio.h"
void panic(char* msg)
{
termio_clear_screen();
termio_fin();
fputs(msg, stderr);
exit(EXIT_FAILURE);
}
int main()
{
if (termio_init()) panic("terminal setup failed");
int i = 0;
while (true) {
printf("... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* put_pile.c :+: :+: :+: ... |
C | #include<stdio.h>
int main()
{
int i;
int *p=NULL;
int a[5]={1,2,3,4,5};
p=a;//p=&a[0]
for(i=0;i<5;i++)
{
printf("%d ",*(p+i));//p[i] a[i] *(a+i)
}
return 0;
}
|
C | /*finding a unique character*/
#include<stdio.h>
#include<string.h>
#include<limits.h>
#define noofchars 256
int uni(char* str)
{
int i,res;
int arr[noofchars];
for(i=0;i<noofchars;i++)
arr[i]=-1;
for(i=0;str[i];i++)
{
if(arr[str[i]]==-1)
arr[str[i]]=i;
... |
C | typedef int Data;
struct listnode {
Data data;
struct listnode *next;
};
typedef struct listnode Listnode;
typedef struct {
Listnode *top;
} Stack;
void init_stack(Stack *s);
int stack_full(Stack *s);
int stack_empty(Stack *s);
void push_stack(Stack *s, Data data);
Data pop_stack(Stack *s); |
C | #include <stdio.h>
#include <math.h>
int main(){
int c;
float num1, num2, res;
printf("\n\n=================================Calculadora====================================\n");
printf("\nEscolha a operação matemática desejada;\n");
printf("1.Adição\n");
printf("2.Subtração\n"... |
C | /* ************************************************************************** */
/* LE - / */
/* / */
/* get_fd_contents.c .:: .:/ . .:: ... |
C | //请设计一个算法,将顺序表中的所有元素逆置
#include<stdio.h>
#define MaxSize 30
typedef struct{
int data[MaxSize]; //静态数组存放数据
int length; //定义当前顺序表长度
}SqList;
/*倒置算法*/
void Inverse(SqList *list){
int temp;
for (int i = 0, j = list->length - 1; i < j; i++, j--){
temp = list->data[i];
list->data[i] = list->... |
C | /*
Implement following programs to exhibit UNIX Process Control
Parent process - sorts array elements in ascending order
Child process - sorts array elements in descending order
Demonstrate ZOMBIE state; where child process terminates and waits for parent process to collect its exit status */
#include <stdio.h... |
C | /*
* main.c
*
* Copyright (c) 2013 Franck Jullien <elec4fun@gmail.com>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free... |
C | #include <assert.h>
#include <sys/time.h>
static int omp_get_max_threads(void)
{
return 1;
}
static double omp_get_wtime(void)
{
struct timeval tp;
int rc = gettimeofday(&tp, NULL);
assert(rc==0);
double t = tp.tv_sec + tp.tv_usec * 1.e-6;
return t;
}
|
C | //
// Created by cout970 on 2017-07-15.
//
#include "macros.h"
#include <string.h>
#include "network.h"
void network_signal(NetworkCard* network, Byte signal) {
((NetworkCard volatile*) network)->signal = signal;
}
Boolean network_is_internet_allowed(NetworkCard* network) {
return network->internetAllowed;
}... |
C | /*
Integrante 1 - Nome:Bruno Camilo ___________________________ RA:16080293
Integrante 2 - Iago Lourenço ________________________________ RA:15610116
Resultados obtidos: Com a resolucao do projeto obtivemos os resultados proposto pelo professor, conseguindo atraves de um programa inicializado junto ao programa obter a... |
C | #include<stdio.h>
int main()
{
int a[5],i,*p;
p=&a[i];
printf("enter any five value:");
for(i=0;i<=4;i++)
{
scanf("%d",&a[i]);
}
printf("the value of array and its address is :\n");
for(i=0;i<=4;i++)
{
printf("the value of a[%d] is %d and address id a[%d] is %u \n",&a[i],p,i);
p++;
}
re... |
C | // Lauro Cruz e Souza - RA: 156175
// laurocruzsouza@gmail.com | lauro.souza@students.ic.unicamp.br
#include "bico.h" /* Robot control API */
/* Ronda */
unsigned int turn;
void ronda(void);
void forward(void);
void turn90(void);
void force_turn(void);
/* Segue parede */
void segue_parede(void);
void busca_... |
C | /*
* =====================================================================================
*
* Filename: 086.c
*
* Description: 086
*
* Version: 1.0
* Created: 06/19/2013 04:39:04 PM
* Revision: none
* Compiler: gcc
*
* Author: Zhang Dongsheng (mars), zhangd... |
C | #include <stdio.h>
// Build and run program given below. Examine the output.
int main(void) {
int a = 5, b, c, d, e;
b = a++;
c = ++a;
d = a--;
printf("a=%d\nb=%d\nc=%d\nd=%d\ne=%d\n", a, b, c, d, e);
return 0;
}
|
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fillit.h :+: :+: :+: ... |
C | #ifndef CSTRING_H
#define CSTRING_H
#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
typedef struct cstring String;
/* initialize string with \\0 on index 0 */
/* @param init_cap initial capacity of string */
/* @return empty string */
String* cs_init(size_t init_cap);
/* create string from raw char p... |
C | #include "testharness.h"
unsigned long x = 0xfffffffffffffffeUL;
int main(){
/* CIL used to truncate unsigned long constants to 32-bits, even on
* 64-bits machines */
if(sizeof(unsigned long) == 8 &&
x == 0xfffffffeUL)
E(1);
SUCCESS;
return 0;
}
|
C | #include "test.h"
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <pthread.h>
#include <assert.h>
char buf[0x400000];
void *tmain(void *arg) {
int fd = open("/dev/crc0", O_RDWR);
if (fd < 0) {
perror("open");
return buf;
}
if (crcdev_ioctl_set_params(fd, 0xedb88320, 0xffffffff)) {
perror(... |
C | #ifndef _STACK_LINKED_LIST_H
#define _STACK_LINKED_LIST_H
#define MAX_CHARS 1000
#include "single_linked_list.h"
#include <stdio.h>
typedef struct {
SingleLinkedList* list;
int top;
int largestString;
} Stack_Linked_List;
Stack_Linked_List* init_stack(size_t);
// Integer init function
Stack_Linked_Lis... |
C | /* prog4_3, ϥprintf() */
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int num=25;
printf("\"%d%%ǥͨӦۤpdax\"\n",num); /* LXr */
system("pause");
return 0;
}
|
C | /*
* TWI.c
*
* Created: 2/20/2021 8:57:13 PM
* Author: karim
*/
#include "TWI.h"
void TWI_MASTER_Init(void)
{
TWBR = 0x0C;/*Prescaler of the clock*/
SET_BIT(TWCR, TWEN);/*Enable Two wire Interface*/
}
void TWI_SLAVE_Init(void)
{
/*Set address for slave*/
TWAR = (0x01 << 1); /*Disable general call*/
SET_BIT(TWCR... |
C | #include <stdio.h>
int longitud(char c[]);
int cuenta_y_sustitucion(char c[]);
void main()
{
char condicion;
char cadena[50]={'\0'};
puts("\t\t/*Programa encargado de tratar con cadenas de caracteres*/");
puts("Cuenta los caracteres, cuenta las palabras de 4 letras \
y sustituye las palabras ... |
C | #include"sender.h"
frame senderQueue[WINDOW_SIZE];
int nStartDataIndex;
void runSender();
void createData(int count);
int checkACK();
int bInitTimer;
clock_t initStart, start, finish;
CRITICAL_SECTION g_cs;
void createSender() {
InitializeCriticalSection(&g_cs);
initStart = clock();
createData(WINDOW_SIZE);
whil... |
C | #include <stdio.h>
union mem {
float x; // 4byte
unsigned char c[4]; //4byte
};
int main(void)
{
union mem A;
union mem B;
A.x = -12.34;
printf("%f\n",A.x);
printf("%x %x %x %x\n",A.c[0], A.c[1], A.c[2], A.c[3]);
printf("=======================\n");
B.c[0] = A.c[0];
B.c[1] = A.c[1];
B.c[2] = A.c... |
C | #include "lists.h"
/**
*sum_listint - Function returns the sum of all the data (n) of linked list.
*@head: points to first node
*Return: 0 is head is empty.
*/
int sum_listint(listint_t *head)
{
listint_t *temp_head = head;
unsigned int sum = 0, count;
for (count = 0; temp_head != NULL; count++)
{
sum = su... |
C | /*
** EPITECH PROJECT, 2019
** NWP_mychap
** File description:
** init
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "handshake/handshake.h"
#include "socket/socket.h"
static char *get_by_key(arguments_t **args, char *key)
{
for (size_t args_index = 0; args[args_index] != NULL; args_index... |
C | #include <stdio.h>
#include "general/GE_state.h"
#include "general/GE_error.h"
#include "general/GE_file_buffer.h"
/*
* prologue: Deal with all args at the program start and in consequence set the
* programs initial state.
*/
int prologue(int argc, char *argv[], F_Buf **io, int st_prg)
{
char c;
int files = 0;
... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <dirent.h>
#include <string.h>
#define BUFFSIZ 4096
int main (int argc, char *argv[]){
int status = EXIT_FAILURE;
if (argc > 3){
printf("Too many arguments!\nusag... |
C | #define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <stdbool.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
#include "estructuras.h"
#include "comunicacion.c"
#include "operaciones.c"
char *segmentoMemoria;
struct globales *vglobales;
/* gene... |
C | #include <stdio.h>
int main()
{
int a,b,i,r,v,num;
scanf("%d %d",&a,&b);
for(i=a+1;i<b;++i)
{
v=i;
num=0;
while(v!=0)
{
r=(v%10);
num+=r*r*r;
v/=10;
}
if(i==num)
{
printf("%d ",i);
}
}
return 0;
}
|
C | #include "dnet_sgx_utils.h"
#include "tree.h"
#include "utils.h"
#include "data.h"
/* void change_leaves(tree *t, char *leaf_list)
{
list *llist = get_paths(leaf_list);
char **leaves = (char **)list_to_array(llist);
int n = llist->size;
int i, j;
int found = 0;
for (i = 0; i < t->n; ++i)
{
... |
C | #include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include "matrix.h"
#define MAX(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
#define MIN(a,b) \
({ __typeof__ (a) _a = (a);... |
C | #include <stdio.h>
#include <stdlib.h>
#include "datastructure.h"
#include "datetime.h"
#include "tools.h"
#include "calendar.h"
#include "menu.h"
#define BUF 255
int main()
{
int Anz = 7;
// int Ende = 1;
char Menu[50] = "TerminVerwaltung V 0.2";
char *Menupunkte[] = {"Neuen Termin anlegen", "Termin ... |
C | /*
* Assignment 3 CS 344 Summer 2015
* Create a program to mimic the functionality of linux system command.
* Design a shell.
*
*/
#define _POSIX_C_SOURCE 200809L
#define _BSD_SOURCE
#define MAX_CMD_LEN 200
#define MAX_ENAME 133
#define block_size 1024
#include <sys/stat.h>
#include <dirent.h>
#include <sys/types.h>
... |
C | /**
* \file threadPool_task.h
* \author Federico Mariti
* Si dichiara che il contenuto di questo file e' in ogni sua parte opera
* originale dell' autore.
*/
#ifndef __THREADPOOL_TASK_H__
#define __THREADPOOL_TASK_H__
#include "taskResult.h"
struct threadPool_task_t;
typedef struct threadPool_task_t threadPo... |
C | /* ############################ */
/* ## PHYS 632 (Spring 2018) ## */
/* ## HW 03 Problem 03 ## */
/* ## Romberg Int. ## */
/* ############################ */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define RN_SIZE 30
float targetFunc(float x){
return pow(sin(x),2);
}
int initRn(fl... |
C | /***********************************************************************
/
/ READ THE SPECTRUM TABLE
/
/ written by: Ji-hoon Kim
/ date: February, 2010
/ modified1:
/
/ PURPOSE:
/ For RadiaitveTransferTraceSpectrum = TRUE, initialize the spectrum
/ table. The table must be tabulated against column den... |
C | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
void base_Two(int a);
void base_Eight(int a);
void base_Sixteen(int a);
int main(){
int a;
printf("Enter a number:");
scanf("%d",&a);
printf("Number in base 2: ");
base_Two(a);
printf("Number in base 8: ");
base_Eight(a);
print... |
C | /**
* Copyright (C) 2017, Hao Hou
**/
/**
* @brief The exotic object data type
**/
#ifndef __PSS_EXOTIC_H__
#define __PSS_EXOTIC_H__
/**
* @brief The data structure used for an exotic object
**/
typedef struct _pss_exotic_t pss_exotic_t;
/**
* @brief The data used to create an exotic object
**/
typedef struct ... |
C | #include<stdio.h>
void main()
{
int c, no;
printf("Enetr a no");
scanf("%d",&no);
switch (no>0)
{
case 1:
{
printf("%d no is positive", no);
}break;
case 0 :
{// condition ofr negative
switch (no<0)
{
case 1:
... |
C | /*
* @Description: In User Settings Edit
* @Author: your name
* @Date: 2019-10-17 17:29:46
* @LastEditTime: 2019-10-17 19:01:13
* @LastEditors: Please set LastEditors
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/queue.h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.