blob_id large_string | language large_string | repo_name large_string | path large_string | src_encoding large_string | length_bytes int64 | score float64 | int_score int64 | detected_licenses large list | license_type large_string | text string | download_success bool |
|---|---|---|---|---|---|---|---|---|---|---|---|
cba6271346e34ef7d024f1c6e7381732426aff6f | C | xWormx/cj_engine | /src/cj_shader.h | UTF-8 | 5,493 | 2.5625 | 3 | [] | no_license | /* date = January 12th 2021 11:44 am */
#ifndef CJ_OPENGL_H
#define CJ_OPENGL_H
struct SHADER_PROGRAM
{
u32 VS = {};
u32 FS = {};
u32 GS = {};
u32 shaderProgram = {};
char *shaderBuffer;
};
void CreateShader(SHADER_PROGRAM *s, char *inFilePath, i32 shader_type);
void LinkShaderProgram(SHADER_P... | true |
527091c6e1b34e1b50a10db859c488546d44b736 | C | dhinck/arith | /ModifyWordPack.c | UTF-8 | 1,992 | 3.453125 | 3 | [] | no_license | /*
* ModifyWordPack.c
* COMP 40 HW 4
* Rebecca Redelmeier & Darcy Hinck
* October 21, 2017
*
* Purpose: Gets and sets necessary variables in a word through calls to
* the bitpack interface
*/
#include "ModifyWordPack.h"
#include "bitpack.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
... | true |
5afb29a3fcc342092bf5471bad4b0b884627daf4 | C | PL2Buddies2017/projectManagement2 | /NetBeansProjects/mutiMapProblem/list.c | UTF-8 | 2,178 | 3.71875 | 4 | [] | no_license | #include "list.h"
#include <stdio.h>
#include <stdlib.h>
void createList(list* l)
{
*l = NULL;
}
void addElement(list* l, entryType item)
{
Node* newNode = (Node*)malloc(sizeof(Node));
newNode->info = item;
newNode->next = *l;
*l = newNode;
}
void createMap(Map* m)
{
*m = NULL;
}
void add... | true |
25b6036b44a84500143bf7cef0e97b05ce82dd48 | C | biabremer/push_swap | /checker_src/flag_management.c | UTF-8 | 2,089 | 2.765625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* :::::::: */
/* flag_management.c :+: :+: ... | true |
2a9ecb8da52fb0b73064afb2e0dc8d3a742d7d24 | C | volkov7/21sh | /srcs/pressed_second_word.c | UTF-8 | 2,169 | 2.75 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pressed_second_word.c :+: :+: :+: ... | true |
0c0e6f71de4f61886ca523add9ccec0893a74a12 | C | EkaspreetSingh/LabPrograms | /6_strings.c | UTF-8 | 981 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
printf("1.To find the length of the string\n2.To concatenate two strings\n3.To find reverse of a string\n4.To copy one string to another string\n choose your option: ");
int option;
scanf("%d",&option);
char a[20],b[20];
... | true |
d2268306dfe7223820e6b2b8814d92889d8c9d1f | C | dmaccormick/Computer_Animation_Techniques | /_Base Visual Studio Project/CollisionBoxes.h | UTF-8 | 1,791 | 2.578125 | 3 | [] | no_license | #pragma once
#include "glm\glm.hpp"
#include "GLUT\glut.h"
struct Col_Sphere
{
Col_Sphere(glm::vec3 pos, float rad) : position(pos), radius(rad) {}
glm::vec3 position;
float radius;
};
struct Col_AABB
{
Col_AABB(glm::vec3 pos, glm::vec3 ext) : position(pos), extent(ext) {}
glm::vec3 position;
glm... | true |
b1701492fa0b0f2ed21e08f32568a304daadac37 | C | fengxingtianxia666/DataStructure | /线性表/2线性表链式存储设计与实现/2线性表链式存储设计与实现/linklist.c | GB18030 | 2,415 | 3.421875 | 3 | [
"MIT"
] | permissive |
#include<stdio.h>
#include "stdlib.h"
#include "string.h"
#include "linklist.h"
typedef struct _tag_LinkList
{
//棬ҪнڵϢҪһʼ
//Ǵͷڵ
LinkListNode header;
int length;
}TLinkList;
LinkList* LinkList_Create()
{
TLinkList *ret = (TLinkList *)malloc(sizeof(TLinkList));
if (ret == NULL)
{
return NULL;
}
//memset(re... | true |
ba72305e6ff6b84e3cba397a730543ed9d91b7de | C | anshu1515/C-Programming | /Loop Exercises/a2z alphabets.c | UTF-8 | 109 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
char ch='a';
for( ;ch<='z';ch++)
{
printf(" %c",ch);
}
return 0;
} | true |
fe3660d2abf19223fdb29f99e6680deb4301be99 | C | jtiagosantos/C-Studies | /Aulas/Aula 43 - Matrizes em linguagem C/main.c | UTF-8 | 440 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
#define LINHAS 3
#define COLUNAS 5
//quando passa matriz para uma função, é obrigatório colocar as dimensões da matriz
void zeraMatriz(int m[LINHAS][COLUNAS]) {
int lin, col;
for(lin = 0; lin < LINHAS; lin++) {
for(col = 0; col < COLUNAS; col++) {
m[lin][col] = 0;
... | true |
404dd82d9c67ba5c66280fd7ac50827faa6ea66b | C | diogomfreitas/pySBFL | /522-B/522-B-bug-10206111-10206127/522-B.c | UTF-8 | 1,376 | 3.578125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
struct element
{
int width;
int height;
};
int main(int argc, char *argv[])
{
struct element *arr;
int count;
int i;
int w = 0, ind_h_max_main = 0, ind_h_max_secondary = 0;
int w_cur;
scanf("%d", &count);
arr = malloc(sizeof(struct element) *... | true |
47e7b38815d5288abca13a24471500c141431db8 | C | VirThomas/Raytracer | /srcs/fill.c | UTF-8 | 4,578 | 2.53125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fill.c :+: :+: :+: ... | true |
6a5c89d8a5a0745d6e6e09e4c8c688edd520f6ea | C | Ramanuj1st/Image_processing_with_C | /main.c | UTF-8 | 6,106 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include<math.h>
#define CUSTOM_IMG_SIZE 1024*1024
int main()
{
FILE *streamIn =fopen("fruits.bmp","rb");
if(streamIn ==(FILE*)0)
printf("unable to open\n");
printf("x");
unsigned char header[54];
unsigned char colorTable[1024];
for(in... | true |
36ea1abb52b4c1aa6ecf1fb9acb6c72f145875fd | C | BuiDucAnh68/Operating-System | /LAB3/example_fork.c | UTF-8 | 246 | 3.390625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main()
{
pid_t pid;
pid =fork();
if(pid == 0)
printf("Child process,pid = %d\n",pid);
else
printf("Parent process,pid =%d <-- This is PID of child process\n",pid);
exit(0);
}
| true |
40e705945f1870ab120557ad32489f5a98eebbbb | C | LuisSalas94/Mastering-Data-Structures-Algorithms-using-C-and-C- | /1.- Recursion/9.- Taylor Series/main.c | UTF-8 | 851 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
//Iteractive
int fib(int n)
{
int t0 = 0;
int t1 = 1;
int s = 0;
if(n<=1)
{
return n;
}
for(int i = 2; i<=n; i++)
{
s = t0+t1;
t0 = t1;
t1 = s;
}
return s;
}
//Recursion
int rfib(int n)
{
if(n<=1)
... | true |
2349ea3f7b6cc27b73285a8fa614a96110a0bae8 | C | rvjansen/crx | /CRX1999/Tools/SHOW.C | WINDOWS-1252 | 3,236 | 2.84375 | 3 | [] | no_license | /*------------------------------------------------------------------------------
show.c 920605 Separate compilation
-----------------------------------------------------------------------------*/
#include "always.h"
/* Here we include the headers for clusters being used (imported). */
/* Order may be important. ... | true |
495dc92d8f858251c0e68579cf7917ebec185b0f | C | jiriklepl/Bachelor-Thesis | /stl.c | UTF-8 | 114 | 3.015625 | 3 | [] | no_license | #include <stdio.h>
void
__print_char(char c)
{
putchar(c);
}
void
__print_int(int num)
{
printf("%d", num);
}
| true |
fd224670c215f18759f8eeab2f35bdd254acb19d | C | SvetlanaBicanin/MATF-materijali | /1. godina/p1 vezbe/lekcija_3-4/zadatak4.c | UTF-8 | 891 | 4.125 | 4 | [] | no_license | /* Napisati funkciju void transponovana(int a[][max], int m, int n,
int b[][max]) koja određuje matricu b koja je dobijena
transponovanjem matrice a. Napisati program koji za učitanu matricu
celih brojeva 1 ispisuje odgvarajuću transponovanu matricu.
Pretpostaviti da je maksimalna dimenzija matrice 50 × 50. U slučaju
... | true |
9472d657b7079399bd7abebf0066490b9e64b647 | C | pidus/cs50 | /pset1/cash/cash.c | UTF-8 | 819 | 3.5 | 4 | [] | no_license |
#include <cs50.h>
#include <math.h>
#include <stdio.h>
float get_input(void);
int main(void)
{
// ask from user
float dollars = get_input();
// list coins
int quarter = 25, dime = 10, nickel = 5, penny = 1;
// convert dollar value to cents
int cents = round(dollars * 100);
// divid... | true |
cbe88965c29a4ca2d491e6328c390d8b73ba37c5 | C | ibrahim140/CPP-CS2600-P2 | /fees.h | UTF-8 | 6,961 | 3.828125 | 4 | [] | no_license | /*
This file contains the functions that will return the cost for taxi fare, lodging fees, parking fees,
and the conference fees as well as the allowed meals costs
*/
#include <stdio.h>
float TaxiFee () { //Prompts user for taxi fee as a float, and returns the given value once validated.
float fee;
p... | true |
d5ae1d088149e4b2767329cbda2f372ca3559931 | C | DanielBrito/ufc | /Estrutura de Dados/Lista 3/Interativo/Exe[17-19]/exe.c | UTF-8 | 1,282 | 3.484375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include "lista.h"
int main(){
Lista* lista, *listaA, *listaB;
lista = cria();
listaA = cria();
listaB = cria();
lista = insere(lista, 9);
lista = insere(lista, 0);
lista = insere(lista, 7);
lista = insere(lista, 8);
lista = insere(lista, 0);
lista = insere(lista, 5);
... | true |
dd22c6841ebc8947c0b1b1dba4e2f10b5e5655f2 | C | Gomavijayan/c-program | /printseries.c | UTF-8 | 264 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int n,k=1,a[10000],i;
a[0]=3;a[1]=4;
scanf("%d",&n);
for(i=0;i<n;i++)
{
a[++k]=(a[i]*10)+3;
a[++k]=(a[i]*10)+4;
}
for(i=0;i<n;i++)
printf("%d ",a[i]);
return 0;
}
| true |
a47cf7cd3e83a7bb7077a3dd467acadb84763591 | C | rbborashan/SDLBrick | /colors.h | UTF-8 | 309 | 2.515625 | 3 | [] | no_license | #ifndef COLORS_H
#define COLORS_H
struct Color {
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
};
#define COL_BK_GREY 32, 33, 36, 255
#define COL_WHITE 255, 255, 255, 255
#define COL_RED 255, 0, 0, 255
#define COL_GREEN 0, 255, 0, 255
#endif // COLORS_H
| true |
6c7a561cdeee0235041641a40562a10c5f6103be | C | H3r3zy/tar | /src/archive/main.c | UTF-8 | 1,865 | 2.703125 | 3 | [] | no_license | /*
** main.c for in /home/sahel/rendu/CPE/Rush
**
** Made by Sahel
** Login <sahel.lucas-saoudi@epitech.eu@epitech.net>
**
** Started on Fri Mar 3 22:01:31 2017 Sahel
** Last update Sun Mar 5 18:51:11 2017 Sahel
*/
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sy... | true |
851730cdfdec1d8be3535ed2f362a2a2b50b8207 | C | lwzswufe/Data_Structures_and_Algorithm_Analysis | /1-11.c | UTF-8 | 4,664 | 3.921875 | 4 | [] | no_license | /*
04-树6 Complete Binary Search Tree (30 分)
A Binary Search Tree (BST) is recursively defined as a binary
tree which has the following properties:
The left subtree of a node contains only nodes with keys less
than the node's key.The right subtree of a node contains only
nodes with keys greater than or equal to the ... | true |
a14aabf766ca6958ac58dfdda1b4b941b3b0d427 | C | YungQuant/42 | /miscPiscine/oper8r.c | UTF-8 | 350 | 3.234375 | 3 | [] | no_license | #include <stdlib.h>
int oper8r(char *s1, char *op, char *s2)
{
int num1;
int num2;
int num3;
num1 = atoi(s1);
num2 = atoi(s2);
if (*op == '+')
num3 = num1 + num2;
if (*op == '-')
num3 = num1 - num2;
if (*op == '*')
num3 = num1 * num2;
if (*op == '/')
num3 = num1 / num2;
if (*op == '%')
num3 = n... | true |
a67011979ac99db5a126ede86f364e8ed23b5db4 | C | edurox/teste | /bla.c | IBM852 | 1,179 | 3.875 | 4 | [] | no_license | /* EU NAO USO PUTS*/
#include <stdio.h>
void primo(int a, int b) {
int i;
for (i = 0; i < 10; i++) {
a = a+i;
}
printf ("NUMERO DO SWAG DO KEVIN %d", a *10*b);
}
void soma (int a, int b) {
int r = a + b;
printf ("SOma = %d\n",r);
}
void sub(int a, int b) {
int r = a - b;... | true |
43cabc07819484f9434ba9f580790937478ab6fe | C | yangfan876/D_Struct | /exchange_sort/sort_method.h | UTF-8 | 1,293 | 3.65625 | 4 | [] | no_license | /**************************************
* bubble sort method
**************************************/
#define TRUE 1
#define FALSE 0
typedef int BOOL;
void bubble_sort (int O_arr[], int num)
{
int i, j;
BOOL changed = TRUE;
for (i = 0; i < num - 1 && changed; i ++)
{
changed = FALSE;
for (j = 0; j < num ... | true |
97cd949e4e731e84cdf02f6fd970e3a172b3c351 | C | vasilismantz/parallel-programming | /ex2.c | UTF-8 | 3,008 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <mpi.h>
#define MAXLINE 400
int getFileLines(FILE *Fin) {
//Find lines of file
int ch;
int l=0;
while(!feof(Fin)) {
ch = fgetc(Fin);
if(ch == '\n') {
l++;
}
}
return l;
}
int main(int argc,char **a... | true |
1b2749e5141728e3c9ca54f339f760274da4fa01 | C | Zach41/UNIX-Demos | /file_io/futimens_demo.c | UTF-8 | 999 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <fcntl.h>
#include <sys/time.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
int main(int argc, char **argv) {
int fd;
struct stat sbuf;
struct timeval tv[2];
if (argc < 2) {
fprintf(stderr, "Usage: %s <pathname> ... | true |
22ae53b3b4a40d0e229d489210c795371a7fcd83 | C | deutschluz/NumericalAlgos | /MPIOMP/rectanglerule.c | UTF-8 | 355 | 3.5 | 4 | [
"MIT"
] | permissive | /* this program computes pi using the rectangle rule */
#include <stdio.h>
#define INTERVALS 1000000
int main(int argc,char *argv[]){
double area,ysum,xi;
int i;
ysum=0.0;
for(i=0;i<INTERVALS;i++){
xi=(1.0/INTERVALS)*(i+0.5);
ysum += 4.0/(1.0+xi*xi);
}
area=ysum *(1.0/INTERVALS);
printf("Area ... | true |
66c4ae2431e6f30258a9d24550071ee126672ee8 | C | cm68/micronix | /extra/2.11/pdp11/usr/src/sys/pdpstand/maketape.c | UTF-8 | 2,172 | 2.59375 | 3 | [
"Zlib",
"Apache-2.0"
] | permissive | /*
* Copyright (c) 1986 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* @(#)maketape.c 1.1 (2.10BSD Berkeley) 12/1/86
* (2.11BSD Contel) 4/20/91
* TU81s didn't like open/close/write at 160... | true |
b96ed649a73f469108f206d2dfe33bcb8b78643c | C | dipankarghosh28/Design-Analysis-Algorithms | /strassen.c | UTF-8 | 6,632 | 3.40625 | 3 | [
"Apache-2.0"
] | permissive | #include<stdio.h>
#include<stdlib.h>
float**initial(int row, int col)
{
float **a,*b,x=0;
int i,flag=1;
a = (float **) malloc(row * sizeof(float *)); //r rows
for(i = flag-1; i < col; i++)
{ if(x==0)
{
b = (float*)malloc(col*sizeof(float));
a[i]=b; //cols for i th row
}
}
return a;
}
float**mova(flo... | true |
c55b6be21a66c50735ae1968acdbb9c7e752d40d | C | mbuszka/univeristy_computer-architecture | /list-1/ex-8.c | UTF-8 | 576 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdint.h>
void secret(uint8_t *to, uint8_t *from, size_t count) {
static const void *labels[] = { &&c0, &&c1, &&c2, &&c3, &&c4, &&c5, &&c6, &&c7 };
size_t n = (count + 7) / 8;
size_t m = count % 8;
int b;
goto *labels[m];
c0: *to++ = *from++;
c7: *to++ = *from++;
c6: *to++ = *fro... | true |
65ff08be705865c4f38de04e2a591b39b20f29da | C | Marceloprime/ICC1 | /exercicio35.c | UTF-8 | 770 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void funcao_tamanho(int *vector,int size, int *tam,int aux,int i);
int main(){
int size,*vector,i,tam=0;
scanf("%d",&size);
vector = (int *) malloc(size*(sizeof(int)));
for(i=0;i<size;i++){
scanf("%d",&vector[i]);
}
funcao_tamanho(vector,size,&... | true |
4a612ccb30c15bec071e5c6f413c8ec505afb0e1 | C | ssrg-vt/Chum-src | /cpp19_artifact/examples/vel/vel.c | UTF-8 | 1,022 | 3.28125 | 3 | [
"Apache-2.0"
] | permissive | #include <math.h>
double get_current_velocity(void);
double get_current_braking_force(void);
double get_current_accel_force(void);
void throw_velocity_exception(void);
const double maxVehicleVelocityAllowed = 58.1152; //58.1152m/s = 130 mph
const double vehicleMass = 1000; //in kg
const double timeStep = .001; //1 ms... | true |
e285f4cf4b1412f101bcacdbbba3acc854e20a6d | C | MisterDeenis/SETR_Labo5_EQ1 | /audio.c | UTF-8 | 3,868 | 2.765625 | 3 | [] | no_license | #include "audio.h"
snd_pcm_t* audio_init(const char *name, int isPlayback, int n_channels, snd_pcm_uframes_t *frames, unsigned int *sample_rate)
{
int err;
snd_pcm_hw_params_t *hw_params;
snd_pcm_t *capture_handle;
snd_pcm_stream_t stream_type = SND_PCM_STREAM_CAPTURE;
if(isPlayback)
{
stream_type = SND... | true |
f32c5150a49bd0ee211640402c51231f4858280f | C | TIMEYXW/practice_c | /08_swap_number.c | UTF-8 | 497 | 3.75 | 4 | [] | no_license | #include <stdio.h>
int swap(int a,int b){
int c;
c = a;
a = b;
b = c;
}
int swap1(int a,int b){
int c;
c = a;
a = 23;
b = 22;
}
int swap2(int *a,int *b){
*a = 23;
*b = 22;
}
int swap3(int *a,int *b){
int c;
c = *a;
*a = *b;
*b = c;
}
int swap4(int *a,int *b){
*a = *b + *a;
*b = *a - *b;
*a = *a -... | true |
4d73ce8e4009271c0a35b425c8721b5e50c98e06 | C | madidas-sudo/bilProj | /SOMO_control.c | UTF-8 | 1,609 | 2.734375 | 3 | [] | no_license | /*
* SOMO_control.c
*
* Created: 24-05-2021 10:59:07
* Author: mariu
*/
#include "uart_int.h"
#define CMDLEN 8
#define SELECT 0x03
#define PLAY 0x0D
void sendCommand(const char* arr)
{
for(unsigned char i = 0; i < CMDLEN; i++)
{
SendChar(*arr);
arr++;
}
}
void initSomo()
{
InitUART(9600, 8, 0);
}
void... | true |
c0172603b3993d9d1f5f57f581cdca2ebc89c584 | C | hkrsmk/c | /Tut11/tutq7.c | UTF-8 | 534 | 3.859375 | 4 | [
"Unlicense"
] | permissive | #include <stdio.h>
void print_matrix(int[][3],int,int);
int main(void)
{
int array [][3] = {{7,8,9},{10,11,12},{13,14,15}};
print_matrix(array,3,3);
return 0;
}
void print_matrix(int array[][3],int row_size, int column_size)
{
int i,j;
for (i=0; i<row_size; i++)
{
for(j=... | true |
98bc50bb870f87af4f18708b71dfe7df3901cb66 | C | roboman2444/wpictf2019awg | /secureshell/secureshell.c | UTF-8 | 1,982 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <stdint.h>
#include <unistd.h>
#include <inttypes.h>
#include <openssl/md5.h>
void init(void){
struct timeval time;
gettimeofday(&time, NULL);
srand((time.tv_sec * 1000000) + (time.tv_usec));
}
void shell(void){
execve("/b... | true |
03d8b69eadfe28309b68099125df14f23f00cbf9 | C | omkar1610/dfslabServer | /day18-Hashing/map.h | UTF-8 | 1,289 | 2.96875 | 3 | [] | no_license |
#ifndef MAP_H
#define MAP_H
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
struct map_node;
typedef struct map_node map_node;
typedef struct
{
map_node **buckets;//nodelist
unsigned nbuckets, nnodes; //num_ele, tot_ele
} map_base;
typedef struct
{
unsigned bucketidx;
map_node *node;
} map_i... | true |
61f4e7d3ea27db5a9273f3a009a77ffa2ce09f34 | C | deepaliborse/C_Basics | /str_vowel.c | UTF-8 | 503 | 4.21875 | 4 | [] | no_license | //Accept strings from user and display counts of vowels in string.
#include<stdio.h>
int main()
{
char string[10];
int i=0, count=0;
printf("Enter the string: ");
//scanf("%s", str);
gets(string);
printf("\nString is: %s", string);
while (string[i] != "\0")
{
if (string[i] == "a" || stri... | true |
c677b6a955d1110e017f2216291ec3ece118a6b3 | C | JMoerman/JM2018TS | /file_operations/access_closed/13_loop_for_pointer_arithmetic.c | UTF-8 | 1,232 | 3.40625 | 3 | [
"MIT"
] | permissive | #include <stdlib.h>
#include <stdio.h>
#include "access_closed.h"
static void initialize_array(FILE* ptr_arr[], int length) {
int i;
FILE** ptr = ptr_arr;
for(i = 0; i < length; i++, ptr++) {
*ptr = fopen("file.txt","r");
}
}
static void close_backwards(FILE** ptr, int to_close) {
int i;
... | true |
f5053bab3a55ad18dfe451f6651d023a680d8a04 | C | shashankarora07/linuxCodes | /fileTransfer/server.c | UTF-8 | 2,970 | 2.765625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/socket.h>
#include<linux/in.h>
#include<pthread.h>
#define MAXLINE 4096
#define SERV_PORT 3006
#define LISTENQ 8
void fileTransfer(int newfd)
{
char buf_recv[100], buf_send[100];
char fbuffer[1000], filebuffer[1000];
char nbytes, len;
FILE *fp;
... | true |
b59e0b811735672346c1669d5b6bff752f3236af | C | thakur-yogesh/fsm-library | /fsm_header.h | UTF-8 | 3,403 | 3.515625 | 4 | [] | no_license | //Various data structures required for the finite state machine
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX_TABLE_ENTRIES 256
#define MAX_STATE_NAME_SIZE 32
#define MAX_FSM_NAME_SIZE 128
enum Final_state{
//bools for final state
fsm_false,
fsm_true
};
struct tt_entry{
//transition t... | true |
ff764bc0600f459c15768cf10eed39a9d8a0c5be | C | lior7daniel/Assigments-AND-Summeries-CS-ArielUniversity | /Operation Systems/FINAL WORK/q_2/2.0-2.1/check_pid.c | UTF-8 | 837 | 3.421875 | 3 | [] | no_license | #include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
void isExists(int pid){
int rc = kill(pid, 0);
if (rc != 0) {
switch (errno) {
case EINVAL: // 22
printf("An invalid signal was specified.\n");
break;
ca... | true |
14aad5954ee6845a69d906fbcd13f6468245d90c | C | AndresEscobarDev/monty | /pchar.c | UTF-8 | 448 | 3.515625 | 4 | [] | no_license | #include "monty.h"
/**
* pchar - Instruction that prints a char.
* @stack: stacker of a doubly linked list
* @line_number: Number line
*/
void pchar(stack_t **stack, unsigned int line_number)
{
if (!stack || !*stack)
{
print_error(line_number, "can't pchar, stack empty");
return;
}
if ((*stack)->n < 0 || (*... | true |
970026f49af990df6de6898866b759bb38ce2a8c | C | Alexandro9911/C_praktik | /Tests.c | UTF-8 | 3,221 | 2.515625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <malloc.h>
#include <mem.h>
#include "longCalculation.h"
void testPlus(){
int result=1;
char osn[] = "10000";
char *end;
int base =strtol(osn,&end,10);
int flag = 1;
char *chA;
char nameInp[] = "C:\\Users\\LEGION\\CLionProje... | true |
7e98abe1c0bed56ce1083c98081787fa88219110 | C | z-iz/42_minishell | /srcs/parser_utils_nodes.c | UTF-8 | 2,411 | 3.078125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parser_utils_nodes.c :+: :+: :+: ... | true |
b839aad0fedee46992531a89b0e2b9ee9d9ce67d | C | kbrafford/pottery | /examples/pottery/qsort_simple/pottery_qsort_simple.c | UTF-8 | 3,083 | 2.65625 | 3 | [
"MIT"
] | permissive | /*
* MIT License
*
* Copyright (c) 2020 Nicholas Fraser
*
* 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, ... | true |
7b2a539723f52446ee4fd74a6ac43341dac1b2e7 | C | node3/Extending-Xinu-OS | /PA0 - Xinu Basics/sys/setdev.c | UTF-8 | 742 | 2.78125 | 3 | [] | no_license | /* setdev.c - setdev */
#include <conf.h>
#include <kernel.h>
#include <proc.h>
extern long ctr1000;
extern int currpid;
extern int allpids[NPROC];
/*------------------------------------------------------------------------
* setdev - set the two device entries in the process table entry
*-----------------------... | true |
54e12a0428ce1ee41d6effc9950d618c0bcfb2ff | C | Cristina-sil/EDII | /projEdii2/operacoes_cliente.c | ISO-8859-1 | 6,379 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <windows.h>
#include "menu.h"
#include "arv.h"
#include "prof.h"
void depto_cadastro(Inst* arv){
char depNome[51], depSigla[11];
int verificacaoDep=0;
system("cls");
printf("====================================");
... | true |
794d192a35fde94e22914e9eba052e50275860ca | C | braddoro/random | /c/random.c | UTF-8 | 2,890 | 3.625 | 4 | [] | no_license | // Pick random values
#include <time.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <limits.h>
#include <sys/stat.h>
#include <sys/types.h>
#define PACKAGE "raval"
#define VERSION "0.0.1"
/* status epilepticus, print help and exit wit... | true |
413b2fefdd37db9d6a213d7a58e822f0b1493b03 | C | pzavar/CS-111 | /Labs/Lab3/Lab3A/lab3a.c | UTF-8 | 11,970 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <limits.h>
#include <stdint.h>
#include <time.h>
#include <getopt.h>
#include "ext2_fs.h"
int fd;
struct ext2_super_block superblock;
struct ext2_group_desc desc_g;
struct ext2_dir_entry dir_en... | true |
681b864ed355b5a12cd655ed81629befd331c635 | C | NikitaBalasahebRaut/StringCopyUsingPtr | /CpyStrUsingPtr.c | UTF-8 | 612 | 3.984375 | 4 | [] | no_license | /*
Problem statement :
Accept string from user and copy the conetents into another string using pointer.
Implement strcpy.
*/
#include<stdio.h>
void CopyStr(char *Src,char *Dest)
{
while(*Src != '\0')
{
*Dest = *Src;
*Src++;
*Dest++;
}
*Dest = '\0';
}
int ma... | true |
43af8fbb289f0e591c93047673ddb0fc9dab9691 | C | saedyousef/CS50x | /pset2/substitution/substitution.c | UTF-8 | 2,747 | 4 | 4 | [] | no_license | #include <cs50.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
bool keyValidation(string key, int keyLength);
string encryptText(string plainText, string key);
int main(int argc, string argv[])
{
// Check if the user has passed the key arg. or not.
if (argc != 2)
{
printf("Usage : ./... | true |
91c01d7a7ae46620b55d2df482aa9829ce23a6e9 | C | marcelolynch/ipcinema | /syncrotest/test.c | UTF-8 | 790 | 2.984375 | 3 | [] | no_license | #include "synchronization.h"
#include <pthread.h>
#include <time.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
static void critical_zone(){
int t = rand()%5 + 1;
sleep(t);
}
static void * thread_work(void* data){
while(1){
int t = rand()%3 + 1;
sleep(t);
int choice = rand()%100;
if(choice... | true |
a92c41497192b60520ac471148e9fb6b67fab2cb | C | YourSignificantOtter/CSC-501 | /csc501-lab3/h/lock.h | UTF-8 | 2,313 | 2.796875 | 3 | [] | no_license | #ifndef _LOCK_H_
#define _LOCK_H_
//#define DBG_PRINT /* Control if the system should Print out */
/* debug statements */
#define NLOCK 50 /* Number of R/W Locks */
#define DELETED -6 /* Lock has been deleted */
#define INIT 0 /* Lock is initialized but unused */
#define FREE 1 /* Loc... | true |
40229b2f59cd8979eabf3e1e865a3a51d9a2d429 | C | davimp/SistemasOperacionais | /ep1/processa_dados.c | UTF-8 | 3,567 | 2.65625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(){
int i, j, k;
int tf[1010], tr[1010], deadline[1010], aux_tf, aux_tr, aux_mud;
char num[10];
char fcfs[50], srtn[50], rr[50];
char s[50], ss[50], sss[50], en[50];
int trace[] = {1, 2, 5, 10, 20, 50, 100... | true |
8c56d271302786654f9dbd65726f2635081bf21e | C | itmoasm2015/elite-exam | /src/9-gen.c | UTF-8 | 225 | 2.875 | 3 | [] | no_license | #include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
void gen(int n, unsigned char *s, size_t *len)
{
*len = n * 7 + 4;
s[0] = 0xff;
for (int i = 1; i < *len; ++i)
{
s[i] = s[i-1] - 1;
}
}
| true |
7041306f193ace8ccd46e0a5535b769cfd43f492 | C | juan-db/libft-asm | /test/ft_memcpy_test.c | UTF-8 | 2,666 | 3.125 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <string.h>
#include "test.h"
#include "libfts.h"
static void print_array(FILE* stream, void* s, size_t bytes);
void* ft_memcpy(void* dst, const void* src, size_t n);
int memcpy_test_input_validation_null_dest()
{
ft_memcpy(NULL, (void*)1, 0);
return 0;
}
int memcpy_test_input_validation... | true |
fbf17368b8c8564098c5027c413cf7602359fdf2 | C | admiral-puri/SavedNT | /c/Basics/greatest3Nos.c | UTF-8 | 539 | 3.984375 | 4 | [] | no_license | //Program to find greater of 3 numbers
//study of else if statement
//refer : conditional branching.txt
//see : else if.png
#include<stdio.h>
int main()
{
int n1,n2,n3;
printf("\n Enter 3 numbers ");
scanf("%d%d%d", &n1,&n2,&n3);
if(n1 == n2 && n1 == n3)
printf("\n All numbers are %d... | true |
515ae9aa90a581cbe682417d86c51e37741a9bdd | C | Cirthy/piscine_aout_2017 | /Rush02/ex00/main.c | UTF-8 | 2,083 | 2.65625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... | true |
7ba4463347cb8e8c9ddf59b7a455b1d43e24e493 | C | jpedrobmedeiros/Aprendendo-a-Programar | /C - Como Programar/Cap 4/Exercicios/4.12/programa.c | UTF-8 | 304 | 3.046875 | 3 | [] | no_license | /*
- Questão 4.12 -
*/
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
int i, soma;
soma = 0;
system( "chcp 65001 > NUL" );
for ( i = 2; i <= 30; i += 2 )
soma += i;
printf( "Soma = %d\n", soma );
system( "pause" );
return 0;
} /* fim [main] */
| true |
35f6b0fb9d49913323f48e4d527987c2410e77be | C | nmittal001/My_C_programs | /6_1.c | UTF-8 | 1,819 | 3.265625 | 3 | [] | no_license | #include <stdio.h>
#include <ctype.h>
#include <string.h>
#define NKEYS (sizeof(keytab)/sizeof(keytab[0]))
#define MAXWORD 100
struct key {
char *word;
int count;
} keytab[] = {
"auto",0,
"break", 0,
"case", 0,
"char", 0,
"const", 0,
"continue", 0,
"default", 0,
"unsigned", 0,
"void", 0,
"volatite", 0... | true |
072adf809d1d4a9d7b85ef29a5e5e4d44e819fba | C | wingren013/42-Filler | /bot/piecechooser.c | UTF-8 | 2,445 | 2.84375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* piecechooser.c :+: :+: :+: ... | true |
1372145f51f7cc6bf5126772fad48003efa6921e | C | RamChennale/c | /VOIDPTR.C | UTF-8 | 463 | 3.140625 | 3 | [] | no_license | /*Naresh i Technologies For Any Doubts contact Mr.Balu Email:balu.bhig@gmail.com */
void main()
{
int i=100;
char ch='A';
float f=16.8;
void *ptr;
ptr=(int*)&i;
printf("\n%d %d",i,*(int*)ptr);
/*Naresh i Technologies For Any Doubts contact Mr.Balu Email:balu.bhig@gmail.com */
ptr=(char*)&ch;
... | true |
927173a533b0cb4fba42c0a25b0179ad9a608f96 | C | anwesh-b/TOC | /Class_Works/DFA_class.c | UTF-8 | 674 | 3.28125 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main(){
int currentState = 1,len;
char a,b,str[100];
printf("Enter your string : ");
scanf("%s",&str);
len = strlen(str);
if(len==3){
if(currentState == 1 && str[0]=='a'){
currentState = 2;
... | true |
be4a2ec476f195676f7c6d2d8ca5f32239f2a683 | C | DidiDigi/Aritmetika-dlouhych-cisel | /main.c | WINDOWS-1250 | 1,678 | 2.609375 | 3 | [] | no_license | //3. Seten (respektive vynsoben) sel
//Na vstupu je posloupnost sel oddlench mezerami. Pomoc dlouh aritmetiky naprogramujte:
//a) souet celch sel
//b) souin celch sel
//c) souet relnch sel
//d) souin relnch sel
#include <stdio.h>
#include <string.h>
#include "aritmetika.h"
void main(int argc, char** argv)
{
Cisl... | true |
601764a3f21e66ee35cde8bf44939aee44e15390 | C | GrigoriyBykovskiy/sp_network | /main.c | UTF-8 | 1,503 | 2.6875 | 3 | [] | no_license | #define OBMPIMAGENAME "bmp_encrypt.bmp"
#define OOBMPIMAGENAME "bmp_decrypt.bmp"
#define CSVNAME "output.csv"
#define BYTE_MAX_VALUE 256
#define BIT_BYTE 8
#include <stdio.h>
#include <time.h>
#include "SPN.h"
int user_input(char* filename, unsigned int data_length, unsigned int rounds_count){
/*some exception ... | true |
5ab0cd0067efbd7fc371b91d37b36430b3c06bc3 | C | as010101/Aurora | /aurora_1_2/demos/linear_road/harness/LRReceiver.C | UTF-8 | 5,433 | 2.53125 | 3 | [] | no_license | #include "LRReceiver.H"
// C++ headers
#include <sstream> // for istringstream
#include <iostream> // for cin, cout, cerr
#include <iomanip> // for setw, left
#include <cstdio> // for perror
#include <cerrno> // for perror
// Unix headers
#include <unistd.h> // for read
// Local headers
#include "Socket... | true |
32b76e27048a2a8e5d2ff86ea4a4fef84d7a2ff8 | C | xuchaoxin1375/learnCpp_C | /CProjects/data.structure.c/顺序表.c | GB18030 | 7,363 | 3.875 | 4 | [] | no_license | /*8
ݣеввԳ
3˼
1̬(̬)
ڵǰ˳ͶУʹþ̬Ԫأһ˳ֻܴMAXLENԪء
Ϊ˴ŸԪأҪܹԴſռչΪʵһĿ꣬ǿʹö̬Ԫء
ʱ˳ݽṹͿԶ£ */
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
typedef struct
{
int* elem; // ָűԪصĶ̬ռ
int size; // ̬ռĴС
int n; // һ¼ʵʴŵԪصĸ
} intVec;
// /*... | true |
e6c34aba1725a6af5658ec2fb3c54ca2e3112b8f | C | cataldmj194/Code_Wars | /cprog/level7/PrinterErrors.c | UTF-8 | 295 | 3.125 | 3 | [] | no_license | #include <stdlib.h>
#include <string.h>
char* printerError(char *s) {
int numErrors = 0;
int count = 0;
char *frac = malloc(sizeof(char));
for(; *s; s++,count++)
if(*s < 97 || *s > 109)
numErrors++;
sprintf(frac,"%d/%d",numErrors,count);
return frac;
}
| true |
d5f21d421f149da42e75e53bba6903b393de648b | C | lamtev/compmaths-labs | /lab1/std_lib/src/splines.c | UTF-8 | 1,846 | 2.53125 | 3 | [] | no_license | #include "splines.h"
#include <math.h>
void spline(int n, double *x, double *y, double *b, double *c, double *d) {
int i, ib, nm1;
double t;
nm1 = n - 1;
if (n < 2) return;
if (n < 3) goto l20;
d[1] = x[2] - x[1];
c[2] = (y[2] - y[1]) / d[1];
for (i = 2; i <= nm1; i++) {
d[i] = x[i + 1] - x[i];
... | true |
29cc0d44b5becfc6b2bbc5874f3e3615afc7c9a7 | C | jwlee64/cs120b_finalproject_tetris | /source/main.c | UTF-8 | 12,353 | 2.6875 | 3 | [] | no_license | /* Author: josiahlee
* Partner(s) Name:
* Lab Section:
* Assignment: Final Project
* Exercise Description: [optional - include for your own benefit]
*
* I acknowledge all content contained herein, excluding template or example
* code, is my own original work.
*/
#include <stdlib.h>
#include <stdbool.h>
#incl... | true |
7f449f19529986082769298e700381ef5a043ea5 | C | parvezgitaccount/create-c-language-file | /2varible.c | UTF-8 | 439 | 2.859375 | 3 | [] | no_license | # include<stdio.h>
int main(){
int a=4;
float b =2.56;
char c='u';
int d=34;
int e=5+5;
printf ("The value is a is of a %c %f \n" , c,b);
printf ("The value is a is of a %d \n" ,a);
printf ("The value is a is of a %d \n" ,a);
printf ("sum value o... | true |
464c93c0665cc69a1525159377db840e5983f698 | C | Chu-Jae-Hun/Baekjoon-with-C | /1744.c | UTF-8 | 894 | 3.6875 | 4 | [] | no_license | #include <stdio.h>
int N;
int arr[10000];
int main(void)
{
scanf("%d", &N);
for (int i = 0; i < N; i++)
scanf("%d", &arr[i]);
for(int i = 0; i < N; i++)
{
for(int j = 0; j < i; j++)
{
int temp;
if(arr[i] < arr[j])
{
temp = arr[i];
... | true |
c021d92fc328f0b99fcf9a62be9f88c33d2265ed | C | edharcourt/CS220 | /hw7/merge.c | UTF-8 | 854 | 3.21875 | 3 | [] | no_license | #include "merge.h"
#include <stdlib.h>
int *merge(int *vec1, int n1, int *vec2, int n2) {
int i1 = 0; // current location in vec1
int i2 = 0; // current location in vec2
int i3 = 0; // current location in the resulting array
int *vec3 = malloc((n1 + n2) * sizeof(int));
while (i1 < n1 &... | true |
09b2b3ef2fe094ba585a09705aa70f565cef9288 | C | infyloop/uva-solns | /Arranged/299. Train Swapping/train.c | UTF-8 | 374 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int N,L,A[51],i,j,k,t,x,s;
scanf("%d",&N);
for(i=0;i<N;i++)
{
scanf("%d",&L);
for(j=0;j<L;j++) scanf("%d",&A[j]);
s=0;
for(k=0;k<(L-1);k++)
for(x=k+1;x<L;x++) if(A[k]>A[x]) {t=A[k];A[k]=A[x];A[x]=t;s++;}
printf("Optimal train swapp... | true |
585a80d48ee56498a98091d18281c145d8055397 | C | hdduong/ProgrammingInterview | /ElementsProgrammingInterview/Chapter_6/6.22.PhoneNumber.c | UTF-8 | 661 | 3.125 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
void printCharacter(char *src, int start_at) {
//int i = 0;
//char tmp_src[MAX_CHARACTER];
if (src[start_at] == '\0') {
//return '\0';
printf("%s\n",src);
}
//strncpy(tmp_src,(src + 1), strlen(src) - 1);
switch (src[start_at] ) {
case '2':
s... | true |
10e4791c65dbb87b892c484bb7d0c15428c2a435 | C | rcarette/FT_PRINTFF | /ft_printf/ft_convert_c.c | UTF-8 | 1,548 | 2.796875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_convert_c.c :+: :+: :+: ... | true |
6a68fb478d394943ffe5900120edb832361ebcdc | C | lybabymoon/practice | /ninth homework/No2.c | UTF-8 | 591 | 3.375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int YangShi(int num[][3],int x,int y,int number){
int i = 0, j = y-1;
while (i<x&&y>=0){
if (number > num[i][j]){
i++;
}
else if (number < num[i][j]){
j--;
}
else{
return 1;
}
}
return 0;
}
int main(){
int num[3][3] = { { 1, ... | true |
115489c64158cc8289aab3d272ff344cb3147a87 | C | RenuJ/guvi | /lcm.c | UTF-8 | 180 | 2.78125 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int n1,n2,min;
min=(n1<n2) ? n1:n2;
while(1)
{
if(min%n1==0 && min%n2==0)
{
printf("lcm of %d and %d=%d\n",n1,n2,min);
break;
}
++min;
}
return 0;
}
| true |
d3e9a3bac246a428b6e1f1773713461400391cb9 | C | 280439/practice | /src/compare.c | UTF-8 | 346 | 2.796875 | 3 | [] | no_license | #include "fun.h"
#include "conio.h"
#include "string.h"
int compareString (char *string1, char *string2)
{
if (!string1 && !string2) return 0;
if ( string1 && !string2) return 1;
if (!string1 && string2) return -1;
for (; *string1 && *string2 && *string1 == *string2; string1++, string2++) {}
ret... | true |
525a66f5e695c56242c4ad23471227f4bebcad4d | C | r14sandeep/Test | /C/c_linux/rev/11.c | UTF-8 | 136 | 2.6875 | 3 | [] | no_license | #include<stdio.h>
main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s",string);
}
| true |
11630f53da0f50c40709d7b576bcf5ec28464e48 | C | rainaarya/Refresher_Module_OS | /Assignment2/a2q5.c | UTF-8 | 2,552 | 4.65625 | 5 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void bubbleSort(int arr[], int size)
{
for (int i = 0; i < size - 1; ++i) //perform the loop size-1 times
{
for (int j = 0; j < size - i - 1; ++j) // j<size-i-1 since last i elements are sorted already
{
if (arr[j] > arr[j + 1]) ... | true |
a0e6dec3803b5c468dfe0c18decd326a472c20a1 | C | anistarafdar/c_tutorial | /10_dynamic_arrays/hello_dynamic.c | UTF-8 | 733 | 4.71875 | 5 | [
"BSD-2-Clause"
] | permissive | #include <stdlib.h>
#include <stdio.h>
int main() {
// a_size is the size of the dynamic array to create
int a_size = 10;
// a is an integer pointer initialised to NULl
int *a = NULL;
// allocate enough memory for a_size integers
a = malloc(a_size * sizeof(int));
// if the return from malloc is NULL, an error
... | true |
0f30881b25d05eef9d736f66d30d447e1b3bb32b | C | dgrizelj/0.-Zadaca | /Terza ispit/Terza ispit/anabanana.c | UTF-8 | 930 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <malloc.h>
void sortiranje(int *polje, int pocetni, int zadnji)
{
int i, min = pocetni, tmp;
if (pocetni < zadnji)
{
for (i = pocetni + 1; i<zadnji; i++)
{
if (polje[i]<polje[min])
min = i;
}
tmp = polje[pocetni];
polje[pocetni] = po... | true |
14da8d479ad8b3853607645efdabdbb57159e8e7 | C | bhagavansprasad/students | /siva/process/sharedmemory/shmsrv.c | UTF-8 | 1,736 | 3.125 | 3 | [] | no_license | #include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#define MY_KEY 19920809
#define SHM_SIZE 0x1000
void toggleCase(char *buf,int cnt);
void toggleCase(char *buf,int cnt)
{
int i;
for(i=0;i<cnt;i++)
{
if((buf[i] >= 'A') && (buf[i] <= 'Z'))
... | true |
735408b1447df690f35858348cb1bb42399b4be1 | C | chenre-cjx/learn_linux | /str_del_sub.c | UTF-8 | 1,329 | 3.640625 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <assert.h>
int str_del_sub(char* str1,char* str2);
int main()
{
char str2[] = {"cd"};
char str1[] = {"abcdabcda"};
printf("str1 = %p\n",str1);
printf("str2 = %p\n",str2);
printf("%s\n",str1);
str_del_sub(str1,str2);
printf("str1 : %s\... | true |
32078ec60a3e6bf7f12a6c30fe24fd719d4a0243 | C | CIS-SoftwareDesign-S21/matrix-02-zhou-chen-schaller | /test_mmult.c | UTF-8 | 902 | 2.84375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "mat.h"
#define MAT_SIZE 5
int test_unoptimized(double *a, int arows, int acols,
double *b, int brows, int bcols,
double *c_actual) {
double *c_calc = malloc(MAT_SIZE * MAT_SIZE * sizeof(double));
mmult(c_calc, a, MAT_... | true |
0ae215481173e32fe1a55d586b8e9e34e6408732 | C | padenot/AudioTechnology | /src/snippets.c | UTF-8 | 10,186 | 3.40625 | 3 | [] | no_license | typedef struct {
// in ms
double attack_time;
double attack_gain;
double decay_time;
double decay_gain;
double sustain_time;
double release_time;
} adsr_param;
long gain(float* in, size_t buflen, size_t offset, size_t len, double gain)
{
ASSERT(buflen >= offset + len, "offset + len greater that buffer ... | true |
b8b3606e8fde2de58abfe165c64dfc3fd77654f4 | C | zunp/prog | /e2-22.c | UTF-8 | 311 | 3.40625 | 3 | [] | no_license | //programname: e2-22.c
#include <stdio.h>
int main(void) {
int a, b;
int *p;
a = 100;
p = &a;
b = *p;
printf("aの値 = %d\t aのアドレス%x\n", a, &a);
printf("bの値 = %d\t bのアドレス%x\n", b, &b);
printf("pの値 = %x\t pのアドレス%x\n", p, &p);
return 0;
} | true |
20b3c75ba061387f0c53226d3c773cde33042c7c | C | LoupyLafeuille/zappy | /server/src/time_utils.c | UTF-8 | 505 | 2.515625 | 3 | [] | no_license | /*
** time_utils.c for zappy in /home/pumpkin/Epitech/PSU_2015_zappy/server/src
**
** Made by Loik Gaonach
** Login <gaonac_l@epitech.net>
**
** Started on Thu Jun 23 17:15:00 2016 Loik Gaonach
** Last update Thu Jun 23 17:15:00 2016 Loik Gaonach
*/
#include <stddef.h>
#include "time_utils.h"
unsigned long diff... | true |
0791b9042df40eead9c0b7c02c474f615cffc4dc | C | daniloromero/holbertonschool-low_level_programming | /0x05-pointers_arrays_strings/5-rev_string.c | UTF-8 | 359 | 3.65625 | 4 | [] | no_license | #include "holberton.h"
/**
* rev_string - reverse string
* Description:reverse string
* @s:string to print
*/
void rev_string(char *s)
{
int string = 0;
int index = 0;
char tmp;
while (s[string] != '\0')
{
string++;
}
string--;
while (index < string)
{
tmp = s[index];
s[index] = s[string];
s[stri... | true |
ceb979a91eaaf808f824a76c624b01ef3df3e70e | C | rjmandal/c | /11_1.c | UTF-8 | 265 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
main()
{
int a[9],s=0;
float avg;
printf("enter 10 no to avaerage it ==>>\n");
for(int i=0;i<=9;i++)
scanf("%d",&a[i]);
for(int i=0;i<=9;i++)
s=s+a[i];
avg=s/10.0;
printf("%f",avg);
} | true |
bb7aa8483b3e7e8302bca6cd8b021dc3a3435acc | C | EstephaniaCalvoC/holbertonschool-low_level_programming | /0x0B-malloc_free/2-str_concat.c | UTF-8 | 820 | 4 | 4 | [] | no_license | #include "holberton.h"
#include <stdio.h>
/**
* _strlen - Count the length of a string.
* @s: String.
* Return: Length.
*/
unsigned int _strlen(char *s)
{
unsigned int c;
for (c = 0; s[c]; c++)
;
return (c);
}
/**
* str_concat - Concatenates two strings
* @s1: First string.
* @s2: Second string.
* Ret... | true |
afe693fbd0316d986bc8913ea61a051765899063 | C | lch43/cs-1566 | /src/lab2/vandmlib.c | UTF-8 | 5,998 | 2.96875 | 3 | [] | no_license | #include "vandmlib.h"
#include <stdio.h>
#include <math.h>
void print_v4(vec4 v)
{
printf("[ %f %f %f %f ]\n", v.x, v.y, v.z, v.w);
}
vec4 scalar_mult_v4(float s, vec4 v)
{
return (vec4){v.x * s, v.y * s, v.z * s, v.w * s};
}
vec4 v4_add_v4(vec4 a, vec4 b)
{
return (vec4){a.x + b.x, a.y + b.y, a.z + b.z,... | true |
b16b8a113faafb2bce852d684a9cae4cb0c3d4e3 | C | crotsos/natblaster | /src/share/list.c | UTF-8 | 5,330 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | /*****************************************************************************
* Copyright 2005 Daniel Ferullo *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* y... | true |