language large_stringclasses 1
value | text stringlengths 9 2.95M |
|---|---|
C | #include<stdio.h>
#include<unistd.h>
#include<string.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<stdlib.h>
int count=1;
char *org(char *name)
{
char* tmp=name;
while (*tmp!='\0')
{
if(*tmp=='@')
*tmp=' ';
tmp++;
}
return name;
}
int red_num(char *file)
{
... |
C | #include <stdio.h>
//Declaring the 'Node' struct.
struct Node{
char* next;
int key;
int value;
};
//Declaring the 'LinkedList' struct
struct LinkedList{
char* head;
char* tail;
char* FP;
int numberOfBlocks;
int memSize;
int blockSize;
int listSize;
};
//Declaring the project's necessary functions.
//void I... |
C | #include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<string.h>
struct node
{
int data;
struct node* next;
//struct node* random;
};
int main()
{
int t,z;
scanf("%d",&t);
for(z=0;z<t;z++)
{
struct node* head1=NULL;
struct node* head2=NULL;
int n,x,y,m,i;
scanf("%d... |
C | #include<stdio.h>
char *strcpy (char *dest, char source[]){
int i = 0;
while(source[i] != '\0'){
dest[i] = source[i];
i++;
}
dest[i] = '\0';
}
int main(){
char source[100];
char destination[100];
int n = 1;
while (n) {
printf("Que string?\n");
//isto lê do teclado até encontrar o carac... |
C | /* General Settings */
#define NUM_PIECES 7 // number of pieces
#define NUM_BLOCKS 4 // number of blocks in a piece
#define NUM_ROTATIONS 4 // number of rotations per piece
#define BOARD_WIDTH 10 // number of tiles wide
#define BOARD_HEIGHT 20 // number of tiles high
#define START_ROW 0
#define START_COL 60
#define PR... |
C | #include<stdio.h>
#include<stdlib.h>
#include "a2.h"
void free_array (struct Double_Array* new_struct){
int i;
for ( i = 0; i < new_struct->rowsize; i++) {
free(new_struct -> array[i]); /* free rows */
}
free(new_struct -> array); /* free the array */
free(new_struct); /* free the struct i... |
C | /*xsh_process_ring.c - process_ring */
#include <xinu.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <process_ring.h>
/*------------------------------------------------------------------------
* xsh_process_ring - Count downs a number equal to number of processes times the number of... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include "problem.h"
jmp_buf out;
tProblema *problemAB(tProblema *No)
{
int linhaAux=0, colunaAux=0, numPassosAux = 0, auxMovimento = 0, i, j;
linhaAux = No->linha0;
colunaAux = No->coluna0;
No = createVisited(No);
if(No->resposta ... |
C | /**
* Copyright (C) 2019-2020 Tristan
* For conditions of distribution and use, see copyright notice in the COPYING file.
*/
#include "thread_manager.h"
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "base/global_settings.h"
#define ... |
C | // greatest common divisor and lowest common multiple
// Input:
// First line: Enter a single integer n to represent the number of positive integers to enter
// Second line: The input depends on the number of n to determine the need to enter a few positive integers,
// separated by a blank key
// Output:
// The l... |
C | #include "mystack.h"
#define Share 100
struct sharestack
{
int data[Share];
int top1;
int top2;
}S_S;
void S_Initialize(sharestack &S)//ʼջָ벻ָκԪ
{
S.top1=-1;
S.top2=Share;
}
bool S_StackEmpty(sharestack S)//жջǷΪ
{
if(S.top1==-1&&S.top2==Share)
return true;
else
return false;
}
bool S_Push(sharestack &S,int a... |
C | #include <stdio.h>
int main(void)
{
int nAge = 0;
scanf("%d", &nAge);
if (nAge >= 20)
printf("%d\n", nAge);
nAge = 20;
printf("Final: %d\n", nAge);
return 0;
}
|
C | /*ijϷнսʵ˺㹫ʽΪ
ʵ˺ = ˺ * + 100/100
˺256Ҫҵӡʵ˺
*/
#include <stdio.h>
#include <stdlib.h>
// 1.Ҫ弸 ==> ʵ˺ҵ˺
// 2.Ӧʲôͣ ==> double int double
int main()
{
double shanghai_fact; //ʵ˺
int strength; //
double shanghai_max = 256; //˺
//ϣʼùʽ
printf("뵱ǰɫ");
//&ȡַ
... |
C | /* flash_wcet - try and find the worst latency for writing an image to flash
(c) burin 2020
For fun, but no profit, try running this on a remote
machine while testing:
watch rsync -avh 10.0.0.17:~/ecen5623/simple-capture/wcet/*.ppm .
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#inclu... |
C | #ifndef PRACTICAL_H_
#define PRACTICAL_H_
#include <stdbool.h>
#include <stdio.h>
#include <sys/socket.h>
// Handle error with user msg
void DieWithUserMessage(const char *msg, const char *detail);
// Handle error with sys msg
void DieWithSystemMessage(const char *msg);
// Print socket address
void PrintSocketAddress... |
C | #include "includes.h"
static SDL_Surface *screen;
toggleFullScreen() {
SDL_Surface *screen;
screen = SDL_GetVideoSurface();
SDL_WM_ToggleFullScreen(screen);
} /* toggleFullScreen */
void *doBlit (int srcX,
int srcY,
int srcW,
int srcH,
int destX,
int destY,
int ... |
C | /*
Program testira funkcije strstr(s,t) i strchr(s,c)
*/
#include <stdio.h>
#include <string.h>
int main()
{
char s1[21];
char s2[21];
char c;
char* p;
printf("Unesi dva stringa:");
scanf("%s%s",s1,s2);
/*
Funkcija strstr(s,t) je ugradjena funkcija koja utvr... |
C | /**
* @file activity3.c
* @author Prachi Tanna
* @brief activity 3
* @version 0.1
* @date 2021-04-30
*
* @copyright Copyright (c) 2021
*
*/
#include "activity1.h"
#include "activity2.h"
#include "activity3.h"
#include "activity4.h"
/**
* @brief Initalize PWM
*
*/
void init_pwm(void)
{
TCCR0A |= (1<<... |
C | #include"stdio.h"
void main()
{
int num, i,j,prime=1;
printf("enter no to test:-");
scanf("%d",&num);
for(i=2;i<=num;i++)
{
if(num%i==0)
{
prime=1;
for(j=2;j<=i/2;j++)
{
if(i%j==0)
{
prime=0;
break;
}
}
if(prime==1)
{
printf("%d ,",i);
}
}
}
}
|
C | #include <compound.h>
#define MAX_POOL_COMPOUNDS 100
static struct compound compound_pool[MAX_POOL_COMPOUNDS];
static unsigned int is_compound_creation;
void compound_pool_init(void)
{
unsigned int i;
for (i = 0; i < MAX_POOL_COMPOUNDS; i++)
compound_pool[i].in_use = FALSE;
}
struct compound *compound_create(vo... |
C | // all the function use cases are based on the concept that function pointer can be passed as an argument to another function
// function pointers and callbacks
#include<bits/stdc++.h>
using namespace std;
int acompare(int a,int b)
{
// compare is callback function
// it compares the arguement and
// ... |
C | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
char used[45];
int compar(const void *a,const void *b){
return *((int *)a)-*((int *)b);
}
char is_answer(int a[],int b[],int n,int n_b){
int i,j,k;
for(i=3;i<n;i++){
for(j=0;j<n_b&&used[j]==1;j++);
if(j==n_b) return 0;
a[i]=b[j]-a[0];
used[j]=1;
for(j... |
C | #include <stdio.h>
int main ()
{
long long n, i, k, a, b, c, d;
scanf("%lld", &n);
for (i=1; i<= n; i++)
{
scanf("%lld", &k);
for (a = 2; a*a <= k; a++)
if (k%a == 0)
{
b = k/a;
break;
}
for (c = a+1; c*c <= k; ... |
C | #include "includes.h"
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void asser... |
C | /*******
* Acm_Problem_KTX
* resolver : Kong ji yeon
* date: 2014/02/09
* comment : 폴더만드는법을 몰라 소스만 첨부합니다.
*******/
#include<stdio.h>
#include<stdlib.h>
void Input(int *T,int **M,int ***N);
int* Calculate(int T,int *M,int **N);
void Output(int T,int *answer);
int main(int argc,char *argv[]){
int T; //test case
int *M... |
C | #include <stdio.h>
void swap(int* p, int* q);
int main(void) {
int a, b;
printf("Enter two integer: ");
scanf("%d %d", &a, &b);
printf("Before swap: %d %d\n", a, b);
swap(&a, &b);
printf("After swap: %d %d\n", a, b);
return 0;
}
void swap(int* p, int* q) {
int temp;
temp = *q;
*q = *p;
*p = temp;
} |
C | #include <stdio.h>
int main() {
int x,y;
do{
scanf("%d %d", &x,&y);
if(y>x) printf("Crescente\n");
if(y<x) printf("Decescente\n");
}while(x!=y);
return 0;
}
|
C | //使用malloc在堆区申请动态内存
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int* p1 = (int*)malloc(4);
int* p2 = (int*)malloc(4);
int* p3 = (int*)malloc(4);
int* p4 = (int*)malloc(4);
int* p5 = (int*)malloc(4);
printf("p1 = %p\n",p1);
printf("p2 = %p\n",p2);
printf("p3 = %p\n",p3);
printf("p4 = %p\n",p4);
p... |
C | /* prog10_19, HܼƫVr */
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
char name[20];
char *ptr="How are you?"; /* NЫVr"How are you?" */
printf("what's your name? ");
gets(name); /* LŪJr */
printf("Hi, %s, ",name); /* LXr}Cnamee */
puts(ptr); /* LXptrҫVr */
system("pause"... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* remind_2.c :+: :+: :+: ... |
C | #include <stdio.h>
int main ()
{
int x, y, z, cont;
x=0;
y=1;
for (int i=1; i<=32; i++)
{
z=x+y;
printf("%d\n",z);
if (z%2==0)
{
cont=cont+z;
}
x=y;
y=z;
}
printf("La suma total es de: %d\n", cont);
return 0;
}
|
C |
typedef unsigned char uchar;
#define LOBYTE(x) ((uchar)((x) & 0xFF))
#define HIBYTE(x) ((uchar)((x) >> 8))
unsigned char lin[256] = "asdffeagewaHAFEFaeDsFEawFdsFaefaeerdjgp";
unsigned short icrc1(unsigned short crc, unsigned char onech)
{
int i;
unsigned short ans=(crc^onech << 8);
for (i=0;i<8;i++) {
if (ans ... |
C | /******************************************************************************/
/* DESԳԿ㷨ܽģ */
/******************************************************************************/
#include <stdio.h>
#include <string.h>
//#include "BottomFunction.h"
#define ENCRYP... |
C | #include"header.h"
void cetak(int angka){
if(angka==15){
}
else {
if(angka%2==1){
printf(" %d ",angka);
}
cetak(angka+1);
}
}
void CetakGanjil(int n){
// BASIS
if (n==0){
}
// REKURENS
else{
//CetakGanjil(n-1); //ASCENDING
if... |
C | #ifndef ENEMY_H_
#define ENEMY_H_
#define ENEMY_NUM 26
#define ENEMY_SNUM 50
#include "main.h"
struct ENEMY {
//W
D3DXVECTOR2 enemy_position;
//摜TCY
float width, height;
//oA~AAҁA˃^C~O
int in_time, stop_time, shot_time, out_time;
//G̎
int type;
//e̎
int shotType;
//ړp^[
int move_pattern;
//Vbgp^[
... |
C | #include "types.h"
#include <stdlib.h>
#include <stdio.h>
Color *init_color(unsigned char r, unsigned char g, unsigned char b)
{
Color *color = malloc(sizeof(Color));
color->r = r;
color->g = g;
color->b = b;
return color;
}
void puts_map(float height_map[SCREEN_HEIGHT][SCREEN_WIDTH])
{
for (i... |
C | // Binary operator / division
int main(){
int a = 35;
int b = 5;
return a/b;
}
|
C | #include <stdio.h>
#define BUFSIZE 1024
int main(void)
{
char line[BUFSIZE];
while (fgets(line, BUFSIZE, stdin) != NULL) {
int words = 0, letters = 0;
int i = 0;
while (line[i] != '\n') {
if ((i == 0 && line[i] != ' ') ||
(i > 0 && line[i-1] == ' ' && line[... |
C | #include <sys/socket.h>
#include <string.h>
#include <sys/time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <pthread.h>
#include <ctype.h>
#include <netdb.h>
#include <unistd.h>
#include <arpa/inet.h>
//GLOBALS
//Max Connections
#define N 5
#d... |
C | #include "holberton.h"
/**
* print_diagonal - If else statement
* @n: integer number
* Return: 0 (Succes)
*/
void print_diagonal(int n)
{
int c, i;
c = 0;
while (n > 0)
{
i = c;
while (i > 0)
{
_putchar(' ');
i--;
}
_putchar('\\');
_putchar('\n');
c++;
n--;
}
if (c < 1)
_putchar('\... |
C | #include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main(){
pid_t child_pid, parent_pid;
double s=0.0;
child_pid=fork();
if(child_pid!=0){
s+=3.14;
fprintf(stdout, "CHILD: %i s=%g &s=%u\n", (int) getpid(),s,&s);
}
else{
s+=2.72;
fprintf(stdout, "PARE... |
C | #ifndef RECTANGLE_H
#define RECTANGLE_H
#include <stdbool.h>
typedef struct {int x, y;} point;
typedef struct {point upper_left, lower_right; } rectangle;
int area(rectangle r);
point center(rectangle r);
rectangle move(rectangle r, int x, int y);
bool is_inside(rectangle r, point p);
int height(rectangle r);
int wi... |
C | /*
* File: data.h
* Author: daniel
*
* Created on July 27, 2013, 3:22 PM
*/
#ifndef DATA_H
#define DATA_H
#include "types.h"
#include "memory.h"
/* represents the Data Section of the code */
typedef struct
{
/* the underlying memory buffer */
Memory *memory;
/* the base offset of the data */
... |
C | //
// Created by dholl_000 on 3/24/2018.
//
#define malloc(x) myallocate(x, __FILE__, __LINE__, THREADREQ)
#define free(x) mydeallocate(x, __FILE__, __LINE__, THREADREQ)
#define BLOCK_SIZE 8000000;
#include "myallocate.h"
#include<stddef.h>
#include<stdio.h>
char memory[BLOCK_SIZE] ;
struct block* block... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
//A - tar en beskjed som kommandolinjearg. lagrer beskjeden i variabelen msg
//skriver ut beskjeden "Input: " etterfulgt av msg.
//B - skal gi en feilmelding/hjelpetekst hvis brukeren ikke sender med noe argument
//på kommandolinjen
//C - s... |
C | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
int main(void)
{
int fp;
int p, bytesleidos;
char saludo[] = "Un saludo!!!\n", buffer[10];
p = mknod("FIFO2", S_IFIFO | 0666, 0); //permiso de lectura y escritura
if (p == -1... |
C | /*-------------------------------------------------------------------------
*
* Copyright (c) 2013, Max Planck Institute for Marine Microbiology
*
* This software is released under the PostgreSQL License
*
* Author: Michael Schneider <mschneid@mpi-bremen.de>
*
* IDENTIFICATION
* src/sequence/generation.c
*
*---------... |
C | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "final_project.h"
typedef struct {
int id;
int variant_id;
char selling_price[20];
char rrp_price[20];
int order_limit;
int show_in_price_history;
int active;
char created_at[50];
int product_id;
int marketplac... |
C | /*
* Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/licens... |
C | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// ????
#define D_CHAR_MAX 200005 // ?????
#define D_CHAR_CNT 26 // ?????
// ????
static FILE *szpFpI; // ??
static char sc1StrFrom[D_CHAR_MAX]; // ??? - ... |
C | /*
* reimplementation of Daniel Bernstein's byte library.
* placed in the public domain by Uwe Ohse, uwe@ohse.de.
*/
#include "str.h"
int
str_start(const char *s,const char *t)
{
unsigned int i=0;
for (;;) {
if (!t[i]) return 1;
if (s[i]!=t[i]) return 0;
i++;
if (!t[i]) return 1;
if (s[i]!=t[i]) retur... |
C | /******************************************************************************
Stephanie Lampotang - March 19, 2020
Open Source Contribution for Free Distribution
University of Southern California
Computer Science
Equipment: Arduino Uno, LCD display, wires, buttons, breadboard
Link to purchase:
***************... |
C | #include<stdio.h>
int main()
{
FILE *fp=NULL;
char ch;
int cnt, lines, tabs, spaces, digits, alphabets;
// path mode
fp= fopen("file1.txt","r");
if(fp==NULL)
printf("\n unable to open file");
else
{
cnt= lines= tabs= spaces= digits= alphabets=0;
... |
C | #include <stdlib.h>
#include <stdio.h>
#include "aes-decrypt.h"
void testInvSubBytes();
void testInvShiftRows();
void testInvMixColumns();
int main() {
printf("? TESTING aes-decrypt ...\n");
testInvSubBytes();
testInvShiftRows();
testInvMixColumns();
printf("+ FINISHED aes-decrypt\n")... |
C | /**
6.16 Write a program to print a square of size 5 by using the character S as shown below
a) S S S S S b) S S S S S
S S S S S S S
S S S S S S S
S S S S S S S
S S S S S S S S S S
*/
///program begin
#include<stdio.h>
#include<conio.h>
//main() function begin
... |
C | #pragma once
#ifndef STRING_STREAM_H
#define STRING_STREAM_H
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include "macros.h"
#define STRING_STREAM_OK 1
#define STRING_STREAM_ERR_NO_MEMORY 2
#define STRING_STREAM_ERR_NULL_OBJ 3
#define CHECK_STREAM_PTR(stream) if (stream == NULL) return ... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
int row,line;
char str[100] = {0};
char *p =str;
scanf("%d",&row);
scanf("%d",&line);
getchar();
int i... |
C | /*
Autoria: Eduardo Cortez
Esse programa simula um sistema de cadastro e busca de carros;
Os dados referentes aos carros são:
- marca do veículo
- modelo
- ano de fabricação
- placa (formato XXX-YYYY)
As funções do sistema são:
- Listar os veículos cadastrados;
- Inserir um novo veícul... |
C | #pragma once
#include<stdio.h>
void hexprint(const char* s,size_t len)
{
size_t i;
for(i=0;i<len;++i)
fprintf(stderr,"%.02x ",0xff&s[i]);
fprintf(stderr,"\n");
}
|
C | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include "exe_funct.h"
#include "macro.h"
#include "parse.h"
static char cmd[MAX_COMMAND_LENG... |
C | #include <stdio.h>
#include <stdlib.h>
struct Node{
int data;
struct Node *left;
struct Node *right;
};
struct Node * newNode(int data){
struct Node *temp = (struct Node *)malloc(sizeof(struct Node));
temp->data = data;
temp->left = NULL;
temp->right = NULL;
return temp;
}
void printInorder(struct Node *)... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* f_fractals_b.c :+: :+: :+: ... |
C | /* Dana Alibrandi
* CS 50
* Project 5
* May 7, 2018
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#define UPPER_LIMIT 20
#define LOWER_LIMIT 14
#define DATA_UPPER_LIMIT 99
#define DATA_LOWER_LIMIT 10
#define FALSE 0
#define TRUE 1
/* Function Prototypes */
void initializeProject( int [], int, in... |
C | /* Author: James Ridey 44805632
* james.ridey@students.mq.edu.au
* Creation Date: 10-08-2016
* Last Modified: Wed 10 Aug 2016 09:13:19 AM CDT
*/
#include "file.h"
Data* read_file(FILE* file, Array* array)
{
static Data data = {0};
if(!fread(&data.news, sizeof(short), 1, file)) return NULL;
fread(&dat... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_check_bol.c :+: :+: :+: ... |
C | #include <stdio.h>
#include <limits.h>
void
test0(float a0 , double a1, float a2, double a3, double a4, double a5, double a6, double a7,
double a8, double a9, double a10, double a11, double a12, double a13, double a14, double a15, double a16) {
printf("%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f\n",
a0, a1, a2... |
C |
#include <stdint.h>
typedef enum _direction {
GPIO_OUT = 0, GPIO_IN = 1
} direction_t;
typedef enum {
GPIO_1 = 1,
GPIO_2 = 2,
GPIO_3 = 3,
GPIO_4 = 4,
GPIO_5 = 5,
GPIO_6 = 6,
GPIO_7 = 7,
GPIO_8 = 8,
} gpio_pin;
uint8_t gpio_init();
void gpio_exit();
void gpio_set(gpio_pin gpionum,... |
C | /**
* Ideal Indirection Lab
* CS 241 - Spring 2019
*/
#pragma once
#include "kernel.h"
#include "page_table.h"
#include "segments.h"
#include "tlb.h"
/**
* The file is responsible to excuting the logic of a Memory Management Unit
* (MMU).
*/
// 32768 is the largest process id on most linux systems
#define MAX... |
C | #include<stdio.h>
#include<conio.h>
void main()
{
int n,i,t,a=150,b=160,rem,result=0;
printf("the first interval %d",a);
printf("the second interval %d",b);
{
for(i=150;i<=160;i++)
{
t=n;
while(n!=0)
{
rem=n%10;
result=result+rem*rem*rem;
n=n/10;
}
if(t==result)
{
printf("armstrong number between two intervals are %d "... |
C | #include "libft.h"
char *ft_strmapi(char const *s, char (*f)(unsigned int, char))
{
char *new;
unsigned int i;
size_t len;
i = 0;
len = ft_strlen(s) + 1;
if (s == NULL || !f)
return (NULL);
new = (char *)malloc(sizeof(char) * len);
if (new == NULL)
return (NULL);
while (s[i] != '\0')
{
new[i] = (*... |
C | /*
* ordered_list.h
*
* Created on: Apr 3, 2019
* Author: akos
*/
#ifndef DATA_STRUCTURES_GENERIC_ORDERED_LIST_H_
#define DATA_STRUCTURES_GENERIC_ORDERED_LIST_H_
#include "list.h"
#include <stdlib.h>
typedef int (*comp_function)(void*, void*);
typedef struct __ordered_list_item {
void* data; //a gener... |
C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "listas.h"
#include "funcoes_para_contas.h"
Contas* Contas_busca (Contas* inicio, int v)
{//encontra agencia com mesmo cdigo
Contas* p = inicio;
while(p!=NULL){
if (p->numero_conta == v)
return p;
p=p->prox;
... |
C | #include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(){
printf ("Лабораторная работа №4 Часть 2, выполнили Клементьев С.В., группа ИСТбд-21\n");
int fd[2], res;
size_t size;
char string[] = "Hi, my name is Sergio";
char resstring[21];
/* Создаем pipe */
int er=pipe(fd); // Создаём канал с... |
C | /* display.c -- How to display Info windows.
$Id$
Copyright (C) 1993, 1997, 2003, 2004 Free Software Foundation, Inc.
This program 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 version 2,... |
C | #define _CRT_SECURE_NO_WARNINGS 1
typedef int QUDataType;
typedef struct QueueNode
{
struct QueueNode* _next;
QUDataType _data;
}QueueNode;
typedef struct Queue
{
QueueNode* _front; // ͷ
QueueNode* _rear; // β
}Queue;
void QueueInit(Queue* pq);
void QueueDestory(Queue* pq);
QueueNode* BuyQueueNode(QUDataType ... |
C | #include "ia.h"
int ia_basique(plateau* p, point** point_1, point** point_2, point** point_3, point** point_4, int* size, int c){
/* initialisation d'une liste de tous les pions restants du robot */
liste* l = NULL;
liste* l2 = NULL;
liste_pion(p, &l, c);
while(1){
/* détecte si un pion est proche de la victoir... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printffd.c :+: :+: :+: ... |
C | #pragma once
#define INF 65535
#include"grpAdjMatrix.h"
#include"seqQueue.h"
#include"seqStack.h"
#include"BiTree.h"
#include"forest.h"
typedef struct edgetype
{
int vBegin; //ߵʼţ1ʼ
int vEnd; //ߵһţ1ʼ
int eWeight; //ߵȨֵ
}EdgeType; //
typedef struct minEdgeType
{
int v;//һ˵Ķ
cellType eWeight;//ߵȨֵ
}MinEdge... |
C | #include <sys/socket.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <string.h>
// gcc -g -o libmotan_tools.so -fpic -shared motan_tools.c
int get_local_ip(char * ifname, char * ip)
{
char *temp = NULL;
int inet_sock;
struct ifreq ifr;
inet_sock = socket(AF_INET, SOCK_DGRA... |
C | #include <pebble.h>
#include <time.h>
// Shorthand for debug
#define D(fmt, args...) \
app_log(APP_LOG_LEVEL_DEBUG, __FILE__, __LINE__, fmt, ## args)
#define SEGMENT_RESOLUTION 20
#define RADIUS 50
#define TIME_STRING_BUFFER_SIZE 6
// extends it out a little further to chop off edge of circle
#define EDGE_OF_SEGME... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* exec.c :+: :+: :+: ... |
C | #include "libft.h"
void *ft_calloc(size_t nmemb, size_t size)
{
void *p;
p = (void *)malloc(nmemb * size);
if (!p)
return (NULL);
ft_bzero(p, nmemb * size);
return (p);
}
|
C | /* First version, didnot passed */
struct ListNode* reverseBetween(struct ListNode* head, int m, int n) {
if (!head) {
return head;
}
if (n <= m) {
return head;
}
int delta = n - m;
struct ListNode *fast = head;
struct ListNode *slow = head;
struct ListNode *pre = head;
... |
C | /*
NOMES DOS PARTICIPANTES:
SSC0112 - ORGANIZAO DE COMPUTADORES DIGITAIS I
2 TRABALHO - Simulador de uma CPU MIPS Multiciclo de 32 bits
Weslei Renato de Lima NUSP: 6511258
Wesley Tiozzo NUSP: 8077925
Andreas Munte Foerster NUSP: 7143997
Gabriel Rodrigues do Prado Rossa... |
C | #include <string.h>
#include "kdebug.h"
#include "task.h"
#include "printk.h"
#include "ipc.h"
error_t kdebug_run(const char *cmdline, char *buf, size_t len) {
if (strlen(cmdline) == 0) {
// An empty command. Just ignore it.
return OK;
} else if (strcmp(cmdline, "help") == 0) {
INFO("Ke... |
C | #include<stdio.h>
#include<math.h>
void main()
{
typedef struct point
{
int x,y;
}point;
point p1,p2;
float distance;
printf("/nEnter the coordinate of first pt");
scanf("%d %d",&p1.x,&p1.y);
printf("/nEnter the coordinate of second pt");
scanf("%d %d",&p2.x,&p2.y);
distance=sqrt(pow((p1.x-p2.x),2)+pow((p1... |
C | /*Eric Pickup
03-60-254 Assigment #1
Instructions: Write a program that allows the user to store information about
Facebook posts. For each post, the user wants to store the number of likes and
the number of comments the post received. The name of the post owner (account name),
the size of the post (number of chars), ... |
C | #include <stdio.h>
#include <stdlib.h>
int main()
{
int start, finish;
int lastDigit, firstDigit;
printf ("Enter start value: "); scanf("%d", &start);
printf ("Enter finish value: "); scanf("%d", &finish);
for (start; start<=finish; start++)
{
int temp = start;
lastDigit = temp ... |
C | #include <stdio.h>
#include <stdlib.h>
#define T 3
#define LEN 20
int main()
{
int legajo[T];
char nombre[T][LEN];
int i;
int j;
int auxEnt;
char auxString[20];
for(i=0; i<T; i++)
{
printf("Ingrese legajo: ");
scanf("%d", &legajo[i]);
printf(... |
C |
#ifndef GPIO_H_
#define GPIO_H_
typedef enum {
GPIO_HIGH,
GPIO_LOW
}gpio_state_t;
typedef enum {
GPIO_OUTPUT,
GPIO_INPUT
}gpio_dir_t;
/** Initializes a pin with direction and initial state
* @parm pinNo BCM pin number
* @parm dir direction of data
* @parm state initial state of the pin
*
* @return 0 on... |
C | #include "../api.h"
#include "../behaviour.c"
#include <stdio.h>
#include <assert.h>
void test_getGoalAction()
{
struct Config config = {100., 50., 5.};
struct Ball ball = {1., 0., 0., 0., 0.};
struct Robot robots[12];
robots[0].x = 50.;
robots[0].y = 0.;
robots[0].t = 0.;
robots[0].team = ... |
C | #include<stdio.h>
#include<math.h>
#define MAXOP 100
#define NUMBER '0'
int getop(char []);
void ungets(char []);
void push(double);
double pop(void);
main(int argc, char *argv[])
{
char s[MAXOP];
double op2;
while (--argc > 0)
{
ungets("");
ungets(*++argv);
switch(ge... |
C | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
C | #ifndef MOON_INS_REFERENCE_H
#define MOON_INS_REFERENCE_H
#include "runtime/class.h"
#include "runtime/thread.h"
#include "runtime/rcp.h"
#include "runtime/oop.h"
#include "interpreter/bytecode_stream.h"
#include "interpreter/bytecode_interpreter.h"
// 引用
// GETSTATIC 178 0xb2 获取指定类的静态域,并将其值压入栈顶
// PUTSTATIC 17... |
C | #include <stdio.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
int *iPtr;
char *cPtr;
printf("sizeof iPtr[%p]: %d\n",iPtr,sizeof(iPtr));
printf("sizeof char[%p]: %d\n",cPtr,sizeof(cPtr));
return 0;
}
|
C | /*
** my_realloc.c for RT in /partage/code/c/RT/working_dir/part_parse
**
** Made by mathias lang
** Login <lang_m@epitech.net>
**
** Started on Mon Apr 4 16:39:47 2011 mathias lang
** Last update Fri Jun 3 19:47:49 2011 Mathias Lang
*/
#include <strings.h>
#include <stddef.h>
#include "rt.h"
void *my_realloc(c... |
C | #include<stdlib.h>
void foo(int* p) {
}
int main() {
int *i, *j, *k;
i = (int*) malloc(sizeof(int)*5); // escapes
j = (int*) malloc(sizeof(int)*5); // does not escape
k = i;
foo(k);
return 0;
}
|
C | #include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
const int MAX_CONTRIB = 10;
int Global_sum(int my_contrib, int my_rank, int p, MPI_Comm comm);
int main(int argc, char* argv[]) {
int p, my_rank;
MPI_Comm comm;
int my_contrib;
int sum;
MPI_Init(&argc, &argv);
comm = MPI_COMM_W... |
C | #include<stdio.h>
int main()
{
int i,n,c;
int a=1,b=0;
printf("enter the numbers:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
c=a+b;
a=b;
b=c;
printf("%d",c);
}
return 0;
}
|
C | /*
* File: FunctionElement.h
* Author: alex
*
* Created on 27 June 2014, 18:45
*/
#ifndef FUNCTIONELEMENT_H
#define FUNCTIONELEMENT_H
#ifdef __cplusplus
extern "C" {
#endif
#include "ListOfString.h"
#include <stdio.h>
struct functionElement {
char * NameOfFunction;
ListOfString * LOC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.