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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ed9f3103ed04a375d3be9c67a9913104fea1fb6a | C | knight60615/ProgramDesign | /semester2/practice2.c | UTF-8 | 236 | 2.71875 | 3 | [] | no_license | int *binarysearch(int A[],int target,int n){
int *low=&A[0];
int *high=&A[n];
int *mid;
while(low<high){
mid=low+(high-low)/2;
if(target==*mid)
return mid;
else if(target<*mid)
high=mid;
else if(target>*mid)
low=mid+1;
}
return NULL;
}
| true |
41160fa95723dbba618e2acd53c9824e9125e657 | C | anshulforyou/linux_shell | /cat.c | UTF-8 | 1,062 | 2.734375 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
void main(int a, char** inp){
char * token;
token = strtok(inp[0], " ");
token = strtok(NULL, " ");
if(strcmp(token, "-E")==0){
token = strtok(NULL, " ");
while(token != NULL){
char file1[100];
strcpy(file1, token);
FILE *fptr1 = fopen(file1, "r");
char line1[2... | true |
f0d1b8e49bfe1a3aa434abd6ec09075d19498a16 | C | Mansi449/OS_Assignment7 | /q5.c | UTF-8 | 4,282 | 3.421875 | 3 | [] | no_license | #include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#define N 5 //number of philosophers
/*
use the lpthread flag with gcc to compile this code
~$ gcc q1.c -lpthread
*/
/*
various states of a philosopher
*/
#define THINKING 2
#define HUNGRY 1
#define EATING 0
/*
index of left and ri... | true |
a982aec75dee698ec280b6c7c1c8640904ee3e82 | C | jedisct1/supercop | /crypto_decode/1277x3/ref/decode.c | UTF-8 | 417 | 2.65625 | 3 | [] | no_license | #include "crypto_decode.h"
#include "crypto_uint8.h"
#define uint8 crypto_uint8
#define p 1277
void crypto_decode(void *v,const unsigned char *s)
{
uint8 *f = v;
uint8 x;
int i;
for (i = 0;i < p/4;++i) {
x = *s++;
*f++ = ((uint8)(x&3))-1; x >>= 2;
*f++ = ((uint8)(x&3))-1; x >>= 2;
*f++ = ((ui... | true |
e0b0d829e369b8205621d5d6e2af12402a4e9cdf | C | ArthurKnoep/42sh | /is/is.c | UTF-8 | 547 | 2.734375 | 3 | [] | no_license | /*
** bufferize.c for minishell1 in /home/nicolaspolomack/shell/PSU_2016_minishell1
**
** Made by Nicolas Polomack
** Login <nicolas.polomack@epitech.eu>
**
** Started on Mon Jan 9 10:55:14 2017 Nicolas Polomack
** Last update Sun May 21 11:49:53 2017 Arthur Knoepflin
*/
#include <sys/stat.h>
#include "my.h"
in... | true |
7d51e53fc1b62829fdcd457db22fddcadd36211b | C | vvolkgang/AEJ_Exercicios | /Stacks/Main.c | UTF-8 | 2,456 | 3.96875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#pragma region data_structure
typedef struct _stackNode StackNode;
struct _stackNode{
int value;
StackNode * nextNode;
};
StackNode * _head;
#pragma endregion data_structure
#pragma region methods_signature
/************
* Constructors n ... | true |
22a1a7976231ca27d240d1a7ed1677521511ae26 | C | weenchvd/Introduction_to_Algorithms | /Chapter_07/HoareQuickSort.c | UTF-8 | 2,028 | 3.75 | 4 | [] | no_license | #include "HoareQuickSort.h"
#if DEBUG
#include <stdio.h>
#endif // DEBUG
/* nondecreasing order: type = 1
nonincreasing order: type = 0 */
void HoareQuickSort(int* a, int first, int last, int type)
{
if (type) {
HoareQuickSortNondecreasingOrder(a, first, last);
}
else {
HoareQuickSortNonincreasingOrder(a,... | true |
490da32e9a0de5205d15c4d578a1926db7958fe2 | C | HarshithaRangaswamy/cs525-f18-group-11 | /assign3/storage_mgr.c | UTF-8 | 4,703 | 3.015625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include "storage_mgr.h"
#include<string.h>
FILE *page;
extern void initStorageManager (void){
page = NULL;
}
extern RC createPageFile (char *fileName) {
page = fopen(fileName,"w+");
if(fileName == NULL){
return RC_FILE_NOT_FOUND;
}
if(page==NULL){
fclose(page);
pri... | true |
5a4642a25277a8acd618c68fbbafec46594a301a | C | holypolarpanda7/EDU | /Parallel/pthreads/1_18/3mutex.c | UTF-8 | 1,156 | 3.921875 | 4 | [] | no_license | /* Sample thread program to add the numbers in an array */
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define array_size 1000
#define no_processes 10
int a[array_size];
int global_index = 0;
int sum = 0;
pthread_mutex_t mutex1;
pthread_mutex_t mutex2;
void *slave(void *ignored)
{
int local_index, ... | true |
cf70d41f84db9547cb3a4245749353a371bc8b9f | C | lukamilosevic11/P2-zadaci | /Cas-4/Zadatak16.c | UTF-8 | 491 | 3.421875 | 3 | [] | no_license | #include<stdio.h>
#define MAX 100
void crtanje(int n, int raz);
int main() {
int n;
printf("Unesi n:\n");
scanf("%d", &n);
crtanje(n, 0);
printf("\n");
return 0;
}
void crtanje(int n, int raz) {
int i;
if (n == 1) {
for (i = 0; i < raz; i++)printf(" ");
printf("... | true |
dcb3a2d38d07a8ad0f1ba74a0927f6f1a5f0a141 | C | lvuotto/parallella-btrees | /src/c/b-tree.c | UTF-8 | 9,495 | 3.421875 | 3 | [
"BSD-3-Clause"
] | permissive | #include "b-tree.h"
#include <stdlib.h>
#include <assert.h>
/* ==========================================================================
* PROTOTIPOS
* ========================================================================== */
static b_node_t * b_node_new ();
static b_node_t * b_node_add_nonfull (b... | true |
cd0bd866a26207c8642979ebecd2dbedfcc64157 | C | aadit-n3rdy/zero | /double_list.h | UTF-8 | 2,366 | 3.25 | 3 | [] | no_license | #ifndef DOUBLE_LIST_H
#define DOUBLE_LIST_H
#include <stdlib.h>
#define DOUBLE_LIST_GET_NEXT(double_list_ptr, typename) (typename *)double_list_ptr->next
#define DOUBLE_LIST_GET_PREV(double_list_ptr, typename) (typename *)double_list_ptr->prev
typedef struct double_list {
struct double_list *next;
struct double_li... | true |
a175eced375d30af88d661f312f42cc23f4d9097 | C | 51mple/root-me-2 | /app-systeme/ch5/ch5.c | UTF-8 | 349 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[]){
FILE *secret = fopen("/root/root-me-challenges/app-systeme/ch5/.passwd", "rt");
char buffer[32];
fgets(buffer, sizeof(buffer), secret);
printf(argv[1]);
printf("\n");
printf("%s\n",buffer);
printf("%x\n",buffer);
printf("%p\n",buffer);
... | true |
3870e40e7a938ddecf44dc7a059dbc4493e92fc6 | C | Mr-Grieves/os161 | /os161/kern/fs/vfs/devnull.c | UTF-8 | 1,513 | 2.984375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Implementation of the null device, "null:", which generates an
* immediate EOF on read and throws away anything written to it.
*/
#include <types.h>
#include <kern/errno.h>
#include <lib.h>
#include <vfs.h>
#include <dev.h>
#include <uio.h>
/* For open() */
static
int
nullopen(struct device *dev,... | true |
59360fd636671be85e9c23072e96aebc66fb4253 | C | gonzsa04/SistemasOperativos | /FicherosP4/Obligatoria/Xbox360/xpad/xbox_test.c | UTF-8 | 5,554 | 2.890625 | 3 | [] | no_license | /*
* Extracted from jstest.c developed by Vojtech Pavlik
*/
/*
* This program can be used to test all the features of the Linux
* joystick API. It is also intended to serve as an example
* implementation for those who wish to learn
* how to write their own joystick using applications.
*/
#include <sys/ioctl.... | true |
cc893b950a76dda7c4982dfdeae3dca7327e7d5c | C | bulghur/p600fw | /common/display.c | UTF-8 | 3,614 | 2.734375 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////
// Display update
////////////////////////////////////////////////////////////////////////////////
#include "display.h"
#include "map_to_7segment.h"
#define DISPLAY_BLINK_HALF_PERIOD 20
#define DISPLAY_SCROLL_RATE 12
static st... | true |
441f369cdf38e2d4a84aa62f5f097e5b74969b96 | C | faxiang1230/Demo | /linux/contextswitch.c | UTF-8 | 1,802 | 3.015625 | 3 | [] | no_license | /*************************************************************************
> File Name: switch.c
> Author: wangjx
> Mail: wangjianxing5210@163.com
> Created Time: 2018年10月09日 星期二 14时50分20秒
************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#includ... | true |
a7046ba38575e0880ddd6f309746fdece4a158da | C | jiwang6/compsci210 | /Labs/Lab32/lab32.c | UTF-8 | 5,984 | 3.96875 | 4 | [] | no_license | /** lab32.c
* ===========================================================
* Name: Jim Wang, 12 November 2019
* Section: T3A/4A
* Project: Lab 32
* Documentation: C3C Gills helped me differentiate between tail and head recursion.
* =========================================================== */
#include "lab32.h"
int ... | true |
7eea016e50708b9801c91789578561b832b4bbdc | C | ochestra365/Data_structure_learned_by_C | /피보나치수열.c | UTF-8 | 249 | 3.015625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main() {
int a = 0, b = 1, c = 0, i = 0, answer = 0;
printf("input number : ");
scanf_s("%d", &answer);
for (i = 1, i <= answer; i++) {
printf("%d", a);
c = a + b;
a = b;
b = c;
}
return 0;
} | true |
7d03b3fcc7850c14aea25e182413c1fae7a9bd28 | C | cyzone49/school-OS | /os345argparse.h | UTF-8 | 5,152 | 3.125 | 3 | [] | no_license | #ifndef OS345ARGPARSE_H_
#define OS345ARGPARSE_H_
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "os345.h"
#define MAX_ARG_LEN 256
char* bufferContents;
int nextCharPos;
typedef struct {
int argc;
char** argv;
bool runInBackground;
int errors;
} Parse... | true |
e37a02858eda7ecb93760feea4b90e380f305b2e | C | kevinscorzu/Servidor-Distribuido-Centralizado | /client/src/client/client.c | UTF-8 | 2,314 | 3 | 3 | [] | no_license | #include "client.h"
/**
* Function that makes the ips that will connect to the server
*/
void makeIp() {
char *firstPart = "http://";
char *secondPartImage = "/Api/Analyze";
char* secondPartStop = "/Api/Stop";
serverImageLink = malloc(strlen(firstPart) + strlen(serverIp) + strlen(secondPartImage) +... | true |
75d863bfba23315820aafbab1044f546f9f507c8 | C | Athlon7/LeetCode | /10. Regular Expression Matching/Regular Expression Matching.c | GB18030 | 1,433 | 3.65625 | 4 | [] | no_license | bool isMatch(char* s, char* p)
{
int length_s, length_p, i, j;
int len_flag = 0;
char left, right;
length_s = strlen(s);
length_p = strlen(p);
// unequal lenth
if(length_s != length_p)
{
for(i = 0;i < length_p;i++)
if(p[i] == '*')
{
len_flag ... | true |
e0f5a6d0289367ec8a34b23748c624a4b2c0f77d | C | FrancoUR10/LaboratorioYProgramacionI | /Enunciados del campus virtual/abm_Practica/abm.c | UTF-8 | 1,979 | 3.09375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "abm.h"
int getInt(char mensaje[])
{
int auxInt;
printf(mensaje);
scanf("%d",&auxInt);
fflush(stdin);
return auxInt;
}
float getFloat(char mensaje[])
{
float auxFloat;
printf(mensaje);
scanf("%f",&auxFloat);
fflush(... | true |
e3bf92ed387beaf7d4d98b759ba7292040347cc3 | C | stphnduvall/athena | /src/opcontrol.c | UTF-8 | 1,919 | 2.6875 | 3 | [] | no_license |
#include "main.h"
void operatorControl() {
bool btnPress = 1;
int rightPower;
int leftPower;
while (1) {
//Tank Drive
rightPower = joystickGetAnalog(1, 2);
leftPower = joystickGetAnalog(1, 3);
if(abs(rightPower) > 15 || abs(leftPower) > 15)
{
motorSet(DRIVE_R, -rightPower);
m... | true |
eae80f288598852b23343958a3c204c4114ea59d | C | tomasvillaluro/TecnicaturaPracticos | /Tp_laboratorio_1/main.c | UTF-8 | 3,586 | 3.9375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "funcion.h"
int main()
{
char seguir='s';
int opcion;
float x;
float y;
float resultado;
int pusonumeroUno=0;
int pusonumeroDos=0;
while(seguir=='s')
{
if(pusonumeroUno==0)
{
printf("1- Ingr... | true |
46f5791b63c8304367d667dc6ae8ce6680eab2da | C | hutts24/Blah | /src/blah_entity.c | UTF-8 | 12,221 | 2.9375 | 3 | [] | no_license | /* blah_entity.c
Defines functions which operate upon entities. See blah_entity.h for reference.
*/
#include <stdlib.h>
#include <stdio.h>
#ifdef BLAH_USE_GLUT
#include <GL/glut.h>
#endif
#include <string.h>
#include "blah_entity.h"
#include "blah_macros.h"
#include "blah_matrix.h"
#include "blah_list.h"
#include... | true |
cff81d9270740fe4fae6a84778e2efc0fb8fc033 | C | Aneeque/IDA | /SS09/q9.c | UTF-8 | 335 | 2.515625 | 3 | [] | no_license | #include<stdlib.h>
#include<stdio.h>
int main()
{
printf("Content-Type: text/html\n\n");
printf("<html><head><title>C Script</title></head>");
printf("<body>");
printf("<form action='a.out' method='post'><p>");
printf("<input type='submit' value='Click me!'/>");
printf("</p></form></body></html>");
... | true |
0adc7fa3c8b46870cd90bcd1e8aae3b5451f7265 | C | rd387/C | /Example Sheet 2/Q2_4.c | UTF-8 | 294 | 2.890625 | 3 | [] | no_license |
# include <stdio.h>
int main (void)
{
int i;
do
{
printf("Please input a wind speed: \n");
scanf("%d", &i);
if (i<1)
printf ("If you wish to return to the start press C \n If you wish to quit, input Q \n");
fflush(stdin);
scanf("%s", &q);
} while(q!='Q');
return 0;
}
| true |
841925d65399d307333e0920a56db27ea7f8858c | C | romain-mezghenna/Systemeexploitation | /TD1/TD1.c | UTF-8 | 1,827 | 3.203125 | 3 | [] | no_license | /*// section pour inclure les en-tete
#include <stdio.h>
#include <stdlib.h>
//section pour delarer les fonctions et variables globales
int main(); // cette ligne est optionnelle
int addition(int i, int j); // cette ligne est essentielle
// variable globale
int registre;
//section pour delarer les fonctions
// la fon... | true |
15e6516cd00ad3b247aa70086158623c3feb7e46 | C | ariel2k/1110Programacion_UNLaM | /En clase/09.08 Archivos/01ArchivosBasico.c | UTF-8 | 2,449 | 3.25 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#define nomBin "RegistrosBin.bin"
#define nomText "RegistrosText.txt"
#define TAM 300
#define CON_MSJ 1
typedef struct
{
long dni;
char apyn[36];
char sex;
}t_pers;
void crearBinario (char *nombre);
void crearText (char *nombre);
int abrirArchivo (FILE **fp, char *nombre, cha... | true |
3c7991ad9dc224691fa160dad90671979c5d052b | C | georgemorgan/nes | /ppu.c | UTF-8 | 1,967 | 2.640625 | 3 | [] | no_license | #include "nes.h"
struct _ppu ppu = { .read = &nes_ppu_read_address, .write = &nes_ppu_write_address };
uint8_t nes_ppu_read_null(uint16_t address) {
return 0;
}
void nes_ppu_write_null(uint16_t address, uint8_t value) {
}
uint8_t ppu_read_pattern_table(uint16_t address) {
printf("READ PATTERN\n");
retu... | true |
f5f664ba2ef34b0dfff16acc04ec7884c2c2ebed | C | rastabrandy02/Programming1 | /advanced_exercises/Exercise02.c | UTF-8 | 401 | 3.625 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
int main()
{
int counter = 0;
int num = 1;
int div = 1;
printf(" Prime Number from 1 to 100 are: \n");
printf("1\n");
while(num <= 100)
{
div = 2;
counter = 0;
while (div <= num/2)
{
if (num % div == 0)
{
counter = 1;
break;
}
div++;
}
if (counter == 0... | true |
c5fe3d1fc14da49c52d8376a75fcb9b5de939887 | C | mateioprea/Romanian-SpellChecker | /binary_search.h | UTF-8 | 527 | 3.28125 | 3 | [] | no_license | int binarySearch (char aray[][Length], int size, char search_item[LENGTH]){
int first = 0, last = size -1;
bool found = false;
int position = -1, middle;
while (!found && first <= last){
middle = (first + last ) / 2;
if ((strcmp(array[middle],search_item))==0){
position = mi... | true |
5c2859e2c4d58fc2769ebc97ea084a113bcad8bb | C | berbuf/couver-shell | /src/prompt/aff_prompt.c | UTF-8 | 2,408 | 2.75 | 3 | [] | no_license | /*
** aff_prompt.c for in /home/buffat_b/couver-shell
**
** Made by
** Login <buffat_b@epitech.net>
**
** Started on Wed May 25 14:05:49 2016
** Last update Sun Jun 5 16:16:46 2016 Bertrand Buffat
*/
#include "shell.h"
void erase_down_lines(t_prompt *prompt, int nb_lines)
{
write(1, prompt->start_line_str, str... | true |
6d6c6cb3897907dfa5730aeb8c393c651832d511 | C | caelebk/Computer-Systems-Assignment-6 | /q4a.c | UTF-8 | 290 | 2.859375 | 3 | [] | no_license | int arr[] = {0,0,0,0,0,0,0,0,0,0};
int *base = arr;
void add(int val, int offset){
val = arr[offset] + val;
arr[offset] = val;
}
void main(){
int var1 = 1;
int var2 = 2;
add(3,4);
add(var1,var2);
for (int x = 0; x < 10; x++)
printf("%d\n", arr[x]);
}
| true |
e4d535e455de4575d6e4fe845dc61ca35a580cee | C | tiffanymarthin/directory-tree | /tree.h | UTF-8 | 939 | 3.484375 | 3 | [] | no_license | /**
* Tree data structure header file
*/
#ifndef TREE_H
#define TREE_H
#include <stdio.h>
#include <stdlib.h>
typedef struct treeNode TreeNode;
// Tree node struct
struct treeNode
{
char *path;
char *name;
TreeNode *children;
TreeNode *siblings;
int level;
};
typedef struct tree Tree... | true |
f6d6a300722541a0214cc3b01c09913913a1a43e | C | clemdaniel/274projects | /project3/sensors.c | UTF-8 | 1,205 | 2.875 | 3 | [] | no_license | #include "cmod.h"
#include "timer.h"
#include "oi.h"
#include "sensors.h"
//drive straight until you hit something
void findWall(void) {
drive(100);
for (;;) {
delayMs(100);
getBumps();
if (bumpLeft || bumpRight) {
stop();
break; //escape for loop
}
}
}
//determines the wall sensor strength
// val... | true |
9c1ad355900d9e2462adaad3c5c84ebca249a1f0 | C | lzhansh/lem_in | /srcs/move_util.c | UTF-8 | 1,625 | 2.6875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* move_util.c :+: :+: :+... | true |
f9bec644e356ce4dedf5a8a292937f082cccb7d6 | C | Nellousan/SchoolProjects | /pooldayswork/CPE_BSQ_bootstrap_2019/part1.c | UTF-8 | 1,611 | 3.359375 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2019
** BSQ
** File description:
**
*/
#include <stdlib.h>
#include "my.h"
void fs_understand_return_of_read(int fd, char *buffer, int size)
{
int buff_size = read(fd, buffer, size);
if (buff_size == -1)
my_putstr("read failed\n");
if (buff_size == 0)
my_putstr("rea... | true |
5234063f3100e1482f596d6034d7580bdbaa9320 | C | cr88192/bgbtech_engine | /tools/bggl3/bggl3_builtin.c | UTF-8 | 6,159 | 2.515625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | #include "bggl3.h"
#include <math.h>
int bggl3_id_int, bggl3_id_float, bggl3_id_cons, bggl3_id_null;
int bggl3_id_symbol, bggl3_id_string, bggl3_id_complex;
int bggl3_id_fvector;
elem bggl3_print(BGGL3_State *ctx, elem args)
{
elem a, c;
int i;
c=args;
while(c)
{
a=BGGL3_CAR(c);
i=BGGL3_GetTypeID(a);
if(... | true |
821805d32d73e8c10cf980fb49684f3517d9d643 | C | afonsogoiaba/programacao-C | /05 - while e do-while/04 - ler 10 numeros apresentar divisiveis por 3.c | UTF-8 | 279 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
void main(){
int contador = 1;
int numero;
do{
printf("digite um numero: ");
scanf("%d", &numero);
if(numero % 3 == 0){
printf("o numero %d e divisivel por 3 \n", numero);
}
contador++;
}
while(contador <= 10);
} | true |
9fa053ddea7e14dfe91d0a43c884ef9a0939f31f | C | khans/ProgrammingAndDataStructures | /C/typedef.c | UTF-8 | 198 | 3.390625 | 3 | [] | no_license | #include <stdio.h>
typedef struct a {
int i;
int j;
}a;
*a f(a x)
{
a *r = x;
return r;
}
int main(void)
{
a *x = { 56,89 };
a *y = f(x);
printf("%d\n", y->j);
return 0;
} | true |
63dc436f208c87e3e0f94a0f0e4cce8757fc4c72 | C | ziman/jpg-recover | /main.c | UTF-8 | 4,086 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* jpg-recover -- Extract JPEG/CR2 files from raw bytes (filesystem images etc.).
* Copyright (c) 2011, Matus Tejiscak <functor.sk@ziman>.
* Released under the BSD license: http://creativecommons.org/licenses/BSD/
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "globals... | true |
ff5ad651c7e08777506f71d889e3e1580203a23b | C | PJprogrammer/CS211-CompArch | /hw3/solution/first.c | UTF-8 | 1,177 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include "first.h"
int main(int argc, char* argv[]) {
unsigned short x;
char* command;
unsigned short arg1;
unsigned short arg2;
char* fileName = argv[1];
FILE* fp = fopen(fileName, "r");
fscanf(fp, "%hu", &x);
while(fscanf(fp,"%s\t%hu\t%hu", co... | true |
90e91e66fa22fba0bee7514a8ec8fd091faf5a82 | C | 087260-20-C01-mm/task-9-4 | /N9-4.c | UTF-8 | 687 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
int main()
{int n,m,i,j, k, c, A=0, B=0;
printf("Enter height n and width m\n");
scanf("%d %d",&n,&m);
int a[n][m];
for(i=0;i<=n-1;i++){
for(j=0;j<=m-1;j++){
printf("Enter a[%d][%d]\n",i,j);
scanf("%d",&a[i][j]);
}
}
for(i=0;i<=n*m-1;i++){if((i-1)/m<i/m){ printf("\... | true |
d290444bc813648a2eb50bdcebcf5f8b46b0a2c0 | C | tuwilliam/Embedded-Linux-Webserver | /controller/ip/ipdata.c | UTF-8 | 8,707 | 2.75 | 3 | [] | no_license | #include "../../common/common.h"
#include "../../common/APP.h"
/*
*Find mac flag in table switch
*@author SUN ZHOGNJIAN
*/
void getIpSwitch(){
int rc;
char* sql = malloc(100);
memset(sql, 0, 100);
strcat(sql, "SELECT * FROM switch;");
char* zErrMsg = 0;
rc = sqlite3_exec(db, sql, getSwitch... | true |
a57dbf766755109bebf2e402e99f4a15aa5150df | C | Anu11sha/Fork- | /thread_.c | UTF-8 | 662 | 3.125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
int ar[1000];
int chunk_size=100;
void * TestThread(void *arg)
{
int i=0,sum1=0;
int start=(int)arg;
int end=start+chunk_size;
for ( i=start;i<end;i++)
sum1=sum1+ar[i];
return ((void*)sum1);
}
int main ()
{
int i=0;
for ( i=0;i<1000... | true |
baada2c5e6a215bdfd46a2bd43b4198f35ee6c53 | C | RafaGago/uSHET | /lib/shet.c | UTF-8 | 30,709 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include "shet.h"
#include "shet_json.h"
#include "jsmn.h"
#ifdef SHET_DEBUG
#define DPRINTF(...) fprintf(stderr, __VA_ARGS__)
#else
#define DPRINTF(...)
#endif
//////////////////////////////////////////////////////////////////////////... | true |
edd313dd887f18be26d2da6c3c87161a71769fa1 | C | artemkokhanov/c | /nested-struct.c | UTF-8 | 321 | 3.40625 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
struct person_name{
char first[10];
char middle_initial;
char last[10];
};
struct student{
struct person_name name;
int id, age;
char sex;
};
int main(){
struct student student1;
strcpy(student1.name.first, "Artem");
printf("%s\n", student1.name.first);
return 0;
... | true |
981b887590d980d71f355bac6d0be93353366ab3 | C | asfarcse/C_Code | /VowelCount.c | UTF-8 | 549 | 3.390625 | 3 | [] | no_license | #include<stdio.h>
int main()
{
char A[]="How are you";
int i,vcount=0,ccount=0;
for(i=0;A[i]!='\0';i++)
{
if(A[i]=='a' || A[i]=='e' || A[i]=='i' || A[i]=='o' || A[i]=='u' ||
A[i]=='A' || A[i]=='E' || A[i]=='I' || A[i]=='O' || A[i]=='U')
{
vcount++;
}
... | true |
cba0c42c6b8e9a4f42838883df9dcbcac9d8e18d | C | otto-krause/Guia-13-Eric-Leandro | /Vectores/ej9/ej9.c | UTF-8 | 900 | 3.703125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main ()
{
int a[6];
int i;
int Asc=0;
int desc=0;
printf ("Ingrese un listado de 5 numeros \n ");
for (i=0;i<6;i++)
{
scanf ("%d",&a[i]);
}
//1 2 3 4 5 6
for (i=0;i<5;i++)
{
if (a[i]<=a... | true |
b77e96b5aef31f0cacd10ce62ebddcb9cbd2a5c5 | C | yagi2/Competitive_programming | /JOI/2013/Practice/2013-pr-t6/source/2013-pr-t6.c | UTF-8 | 458 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
int main(void){
int N;
char name[256][256];
int i, j;
scanf("%d", &N);
for (i = 0; i < N; ++i){
scanf("%s", name[i]);
}
for (i = 0; i < N; ++i){
for (j = 0; name[i][j] != '\0'; ++j){
if (name[i][j] >= 65 && name[i][j] <=90){
... | true |
5d2a8b3a46e56d3219f18ccc482b912bf5976a46 | C | wilkerdn/Trocar-e-somar-valores-de-vetores | /Código/main.c | UTF-8 | 741 | 3.484375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
void trocaVetor(int *v1, int v2[5]){
int i, aux;
for(i=0; i < 5; i++){
aux = v1[i];
v1[i] = v2[i];
v2[i] = aux;
}
}
void somaVetor(int v1[], int *v2, int v3[5]){
int i;
for(i=0; i < 5; i++){
v3[i] = (v1[i] + v2[i]);
}
}
int main(){
int i;
int vetA[5], vetB[5], vetC[5];
for... | true |
6435e0f970fce8f6683e01e1fe0681bae397e168 | C | GiovaniHMilani/grafos-prim | /prim.h | UTF-8 | 1,348 | 2.875 | 3 | [] | no_license | #ifndef PRIM_C
#define PRIM_C
struct prim {
char nome_arquivo[64];
int vertices;
int arestas;
int **grafo; // grafo com ate max_vertices quantidades de vertices
int max_vertices;
int infinito;
int custo_minimo; // custo minimo do grafo
char arquivo_saida[64]; // armazena arquivo de saida
};
typedef struct pri... | true |
8518d7ed2f87c605f016418b84af9303209bd9c0 | C | rickhaffey/CSC480 | /FinalProject/CSC480.FinalProject.C/main.h | UTF-8 | 873 | 2.671875 | 3 | [] | no_license | #define MAXROWS 10
#define MAXCOLS 10
#define TRUE 1
#define FALSE 0
#define TOP_MARGIN "\n"
#define LEFT_MARGIN "\t"
#define BOTTOM_MARGIN "\n"
enum gameResults { IN_PROGRESS, DRAW, WIN1, WIN2, INVALID_MOVE1, INVALID_MOVE2, TIMEOUT1, TIMEOUT2, ERROR };
struct game {
int rows;
int columns;
int piecesToWin;
int... | true |
ec3436de3933fa12b98dfbb94d62b2b190f76b5b | C | an-and10/Graph-Algorithms | /Heap and Priority Queue/heap.c | UTF-8 | 5,594 | 3.640625 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
void randomArray(int arr[], int n)
{
srand(time(0));
for(int i = 0; i<n; i++)
{
arr[i] = rand()%99;
}
}
int left(int i)
{
return (2*i)+1;
}
int right(int i)
{
return (2*i)+2;
}
int parent(int i)
{
return (i/2)-1;
}
void swap(int *a,int *b)
{
int temp;
... | true |
66b0efb444a0b93554c7cd4726ac8395771ad397 | C | Majeekfinger/holbertonschool-low_level_programming | /0x05-pointers_arrays_strings/4-rev_array.c | UTF-8 | 552 | 4.3125 | 4 | [] | no_license | #include "holberton.h"
/**
* reverse_array - This function reverses the content of an array of
* integers
* @a: The array of integers to reverse
* @n: The number of elements in the array
*/
void reverse_array(int *a, int n)
{
int i, tmp;
/* loop through array reversing elements */
for (i = 0; i < n; i++)
{
... | true |
fbc4a81a363ad4e4bcc4196dbe8b63ca1bce8482 | C | rpkkumar/praveenkumarR | /praveen15.c | UTF-8 | 151 | 2.875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int start,end,i;
scanf("%d %d",&start,&end);
for(i=start+1;i<end;i++)
{
if(i%2==0)
{
printf("\t %d",i);
}
}
return 0;
}
| true |
6c2706269b1fbdb6c4361629c683951e19a075a8 | C | awelch83/Codechef | /practice/beginner/flow004.c | UTF-8 | 505 | 3.46875 | 3 | [] | no_license | #include <stdio.h>
int rev(int);
int fl(int);
int main()
{
int i;
int num;
int tests;
scanf("%d", &tests);
for(i = 0; i < tests; i++)
{
scanf("%d", &num);
printf("%d\n", fl(num));
}
return 0;
}
int fl(int num)
{
int sum = 0;
sum += num % 10;
sum += rev(... | true |
f39c02ae63f94c82d7eca26d251a996d7540ce1c | C | ExploitSori/ajou-whois-c | /beakjoon/2231/main.c | UTF-8 | 289 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
int main(void){
int n;
int result=0,tmp;
int i,flag=1;
scanf("%d",&n);
for(i=1;i<n;i++){
result=i;
tmp=i;
while(tmp){
result+=tmp%10;
tmp/=10;
}
if(result==n){
printf("%d\n",i);
flag=0;
break;
}
}
if(flag)
printf("0\n");
return 0;
}
| true |
378916752f52f0d1634f1a8d687080e1fc40e754 | C | AxayPatoliya/TCS-preparation | /main.c | UTF-8 | 3,348 | 4.03125 | 4 | [] | no_license | //first 5 topics from the PDF
#include <stdio.h>
#include <math.h>
// global variables in C
char intro[100] = "Logic matters, language doesn't";
// functions in C
int add(int a, int b){
int c;
c = a + b;
}
int max(int a, int b){
if (a > b)
return a;
else
return b;
}
void name(char n... | true |
949649178efbc09f40773908812c38800c035117 | C | sebastianlencinas/tp_laboratorio_1 | /main.c | ISO-8859-1 | 2,293 | 3.859375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "calculadora.h"
int main(void) {
setbuf(stdout,NULL);
char opcionLetra;
float numUno;
float numDos;
float resultadoSuma;
float resultadoResta;
float resultadoDivision;
float resultadoMultplicacion;
float resultadoFactorialUno;
float resultadoF... | true |
45ee9813c93b2a1d6616985c14d19c9a305009e3 | C | ajaykumar-23/Datastructures | /duplicate.c | UTF-8 | 256 | 3.25 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int i,res=0;
int arr[11];
printf("enter array elements\n");
for(i=0;i<11;i++)
scanf("%d",&arr[i]);
for(i=0;i<11;i++)
printf("array elements are %d\n",arr[i]);
for(i=0;i<11;i++)
res=res^arr[i];
printf("%d\n",res);
return 0;
}
| true |
fac17470f4dc429ec278c6bed81650493c1eea5a | C | RoziPetkova/SoftUni-Homework | /4.1 C Programming/Homework 10 C Characters and Strings/Problem 03. Series of Letters.c | UTF-8 | 1,434 | 3.796875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *read_line();
char *remove_equal_consecutive_chars(char *input);
int main()
{
char *string = read_line(&string);
string = remove_equal_consecutive_chars(string);
printf("%s\n", string);
return 0;
}
//removes equal consecutive chars ex. ... | true |
c273d6682182d1405c6fd5f787e6f5364fc9cdb5 | C | kundan9572/Data-Structure-And-Algorithm | /dfs-algo/main.c | UTF-8 | 1,461 | 3.171875 | 3 | [] | no_license | /******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from a... | true |
243172b4be3de4bc728455b8bd6db0963a0bed3d | C | spbu-coding/6-michael555444 | /src/checkup.c | UTF-8 | 2,545 | 2.921875 | 3 | [] | no_license | #include "checkup.h"
#define error_print(...) fprintf(stderr, __VA_ARGS__)
int error(char *error) {
error_print("%s\n", error);
return UNSUCCESS;
}
bool check_count_of_parameters(parameters_count_t parameters_count) {
if (parameters_count == PARAMS_COUNT) {
return true;
}
return false;
}
... | true |
7a56a2d43b4b0c448f5e75124f3e43adb329a9a8 | C | samircosta92/linguagem_C | /1FAC/Exemplos/Lista 3/Lista 3 - Algoritmo 8.c | ISO-8859-1 | 1,751 | 3.921875 | 4 | [] | no_license | /*QUESTO 08: Em uma empresa deseja-se fazer um levantamento sobre algumas
informaes dos seus 250 funcionrios. Cada funcionrio dever responder um
questionrio ao qual informar os seguintes dados: matrcula, sexo, idade,
salrio e tempo (em anos) de trabalho na empresa. A execuo do programa deve
exibir os seguintes iten... | true |
7439db49fd80b27f8f6d06658ab4b0e6be687d31 | C | boli249/bit-c- | /test_8.7.c/test_8.7.c/test.c | GB18030 | 515 | 3.40625 | 3 | [] | no_license | #define _CRT_SECURE_NO_DEPRECATE 1
#include <stdio.h>
int main()
{
int arr[] = { 1, 2, 3, 4, 5, 1, 2, 3, 4 ,5,8,9};
int i = 0;
int ret = 0;
//int j = 0;
int sz = sizeof(arr) / sizeof(arr[0]);
for (i = 0; i < sz; i++)
{
ret = ret^arr[i];
/*int count = 0;
for (j = 0; j < sz; j++)
{
if (arr[i] == arr[... | true |
664f0d8bd773b3cc47b31ea583daa9291a32d797 | C | sarathchandra270/CSC-501-Operating-Systems- | /PA2/csc501-lab2-qemu/TMP/task1.c | UTF-8 | 1,528 | 3.09375 | 3 | [] | no_license | #include <conf.h>
#include <kernel.h>
#include <proc.h>
#include <lock.h>
#include <stdio.h>
#define DEFAULT_LOCK_PRIO 20
void sem_fun (char *msg, int sem)
{
kprintf ("%s:to acquire sem\n", msg);
wait(sem);
kprintf ("%s:acquired sem\n", msg);
sleep (2);
kprintf ("%s:to release sem\n", msg);... | true |
d5ef680e5f9339f04380b3054492408d5d870a3a | C | TOMsworkspace/Linux-Network-Program-Samples | /environ.c | UTF-8 | 106 | 2.703125 | 3 | [] | no_license | extern char** environ;
main()
{
char** env=environ;
while(*env){
printf("%s\n",*env++);
}
return;
}
| true |
c8343dc8f6392a4ce4ef9fd7bee357d3feb2935c | C | mregulski/ppt-3-akiso | /lista4/z2/2a_sigtest.c | UTF-8 | 638 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
#include <signal.h>
void handler(int signum)
{
signal(signum, handler);
printf("caught: %d\n",signum);
}
int main(int argc, char* argv[])
{
printf("test\n");
for (int i=1; i<=64; i++ )
{
// signals 32 and 33 are not in kill -l
if(i!=32 && i!=33)
{
... | true |
3f0b743dfd4f78bf9bda613e4ee148f490af89ac | C | FuriousBerserker/OCRDebugRuntime | /tests/non-regression-tests/dist/testDb64Users.c | UTF-8 | 2,416 | 2.578125 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* This file is subject to the license agreement located in the file LICENSE
* and cannot be distributed without it. This notice cannot be
* removed or modified.
*/
#include "ocr.h"
#include "extensions/ocr-affinity.h"
/**
* DESC: This program spawns a "latch" event, N task "A"'s and N "once" events.
* Task A... | true |
6518e96a2a38f1653152109aef8229156ab9413d | C | vdsudra/code | /ed/training/postfix.c | UTF-8 | 522 | 3.859375 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int stack[10];
int top=0;
int push(int x)
{
stack[top++]=x;
}
int pop()
{
int d=stack[--top];
return d;
}
int expr(char ch)
{
int a,b;
int c;
b=pop();
a=pop();
if(ch == '+')
{
c=a+b;
}
else if(ch == '-')
{
c=a-b;
}
else if (ch == '*')
{
c=a*b;
}
push(c);
}... | true |
a9d39b6feebcce604b68fb9cf9caca5d52662da2 | C | hoshianaaa/divide_files | /divide_files.c | UTF-8 | 2,579 | 3.34375 | 3 | [] | no_license | // divide_files.c for Yolo
// Compile: gcc -o divide_files divide_files.c
// Usage:
// ./divide_files
// ./divide_files [portion]
// portion: the portion of test data. The default value is 0.2.
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <sys/types.h>
#include <diren... | true |
02175d50f69f57f4efa26af6fa314e88d9920ec6 | C | scriptzteam/SCENE-SCRiPTS | /Others/Other/glftpd_scripts/jehsom/mtime.c | UTF-8 | 719 | 3.265625 | 3 | [
"WTFPL"
] | permissive | /* mtime.c, by Jehsom.
* Shows the modification time of a file in epoch time.
* This software is property of the public domain.
*/
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <time.h>
#include <strings.h>
#define TIMELEN 300
int main( int argc, c... | true |
75f342f84dc8b3b0d99fc101589849cd77d75413 | C | avisy1996/GE_Code | /C/Assignments/Assignment2/sappend.c | UTF-8 | 270 | 2.734375 | 3 | [] | no_license | #ifndef _STDIO_H
#include <stdio.h>
#include "Assignment2.h"
#endif
char *sappend (char *str1, char *str2)
{
while (*str1 != '\0') {
str1 ++;
}
while (*str2 != '\0') {
*str1 ++ = *str2 ++;
}
*str1 = '\0';
return str1;
}
| true |
d892f7b1e01cd6c84b7e12087aa9455a34532a6e | C | panulland/OSlab | /lab4/lab/app/main.c | UTF-8 | 2,621 | 3.046875 | 3 | [] | no_license | #include "lib.h"
#include "types.h"
int data = 0;
void producer(int pid, sem_t mutex, sem_t empty, sem_t full) {
int i = pid - 1;
for(int k = 0; k < 8; k++) {
sem_wait(&empty);
printf("pid %d, producer %d, produce, product %d\n", pid, i, k + 1);
sleep(128);
printf("pid %d, prod... | true |
9588a4792fda0200815fc1856545ab34500a3bd5 | C | Sarowar-Sagor/Testgit | /Two dimension Array of pointer.c | UTF-8 | 543 | 3.203125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main()
{
int *ar[5],n[5],i,j,m;
for(i=0;i<5;i++)
{
printf("Enter number of student for class %d\n",i+1);
scanf("%d",&m);
n[i]=m;
ar[i]=(int *)malloc(sizeof(int)*m);
if(ar[i]==NULL)
{
printf("Memory allocation failed\n");
return 1;
... | true |
6c858b82726308a492caac51240b88eba4a5d0cb | C | ellisonch/c-semantics | /tests/unitTests/cq-09-s626.c | UTF-8 | 2,849 | 2.640625 | 3 | [
"MIT",
"NCSA"
] | permissive |
#include "cq-header.h"
int sec(pd0) /* 6.2 Float and double */
/* 6.3 Floating and integral */
/* 6.4 Pointers and integers */
/* 6.5 Unsigned */
/* 6.6 ... | true |
cc911c4b80a2ea8fc5d027afd69b8e03c05b87be | C | tigredonorte/aedstpsthom | /aeds/tp3/TP3/src/interface.c | UTF-8 | 3,624 | 2.90625 | 3 | [] | no_license | #include "interface.h"
void setEntradaGrafo(Grafo *grafo, char *entrada)
{
char **Buffer;
int size;
Buffer = leArquivo(entrada, &size);
if(Buffer == NULL)
{
printf("\nErro ao ler arquivo, o programa sera fechado!!\n");
exit(EXIT_FAILURE);
}
int i, V1, V2, NVertices, NAresta... | true |
ef31f047051a81bde132cc0abfc6ca19e8c065a1 | C | knskamila/Cell-distances | /main.c | UTF-8 | 6,565 | 3.0625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <omp.h>
#include <math.h>
#define LINE_SIZE 26 //strict file format: assuming fixed length for each line and value
#define POINT_SIZE 8
#define MAX_OUTPUT 3464
#define MAX_LINE_COUNT 1000000 //maximum of lines to be allocated at once
... | true |
1971ab8ba911415331b6a26f205c4dfb820c7bd8 | C | qwe661234/datastructurepractice | /hw4/solitaire.c | UTF-8 | 2,484 | 3.34375 | 3 | [] | no_license | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
struct card{
int data;
struct card *next;
};
typedef struct card card;
int check(int b, int* count){
if(count[b - 1] == 0){
count[b - 1] = 1;
return b;
}else{
b = rand() % 13 + 1;
return check(b, count);
}
};
... | true |
ad90c12831f8e6c561d29b26828f49fde1faa420 | C | dcobas/CTC | /lib/CtcIoctlAccess.c | UTF-8 | 29,597 | 2.671875 | 3 | [] | no_license | #include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <stdlib.h>
#include "CtcDrvr.h"
#define _DRVR_NM_ "CTC"
#define matchEndian(bytes, size, depth) { }
/**
* @brief Open devic... | true |
1a14f9bedd17a92337b108227915b657f130a7db | C | AmilcarArmmand/binary_trees | /6-binary_tree_preorder.c | UTF-8 | 584 | 3.921875 | 4 | [] | no_license | #include "binary_trees.h"
/**
* binary_tree_preorder - a function that pre-order traverses a binary tree
* @tree: a pointer to the root node of the tree to traverse
* @func: a pointer to a function to call for each node, value passed as param
*
* Return: No data type returned. If tree or func is NULL do nothing.... | true |
3774cef59275f939aec443f3ab66adadd470f573 | C | shumbul/DSA | /Algorithms/Recursive Algorithms/C/towerOfHanoi.c | UTF-8 | 454 | 3.921875 | 4 | [] | no_license | #include<stdio.h>
int cnt=0;
void move(int,char,char,char);
int main(){
int disk;
printf("Input num of disks : ");
scanf("%d",&disk);
move(disk,'A','B','C');
return 0;
}
void move(int n, char a, char b, char c)
{
if (n == 1)
{
++cnt;
printf("\n%5d: Move disk 1 from %c to %c", cnt, a, c);
return;
}
els... | true |
6e579de3a158adaaf3326a3a62bc51b6c104cb45 | C | SubZer0811/OS | /Lab-4/src/learn_shm.c | UTF-8 | 718 | 2.890625 | 3 | [] | no_license | #include<sys/ipc.h>
#include<sys/shm.h>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
int main (){
// ftok to generate unique key
key_t key = ftok("shmfile",65);
// shmget returns an identifier in shmid
int shmid = shmget(key,5*sizeof(int),0666|IPC_CREAT);
// shmat to attach to shared memory ... | true |
6d601d2a3aa9a9d6faf50e29657f7efe1ae143b4 | C | matteoscazzoli/RiMMS-Linux | /sw/utility.c | UTF-8 | 2,360 | 2.84375 | 3 | [] | no_license | #include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "utility.h"
unsigned char debug;
int GetClockSecond(void)
{int ret,time;
struct timespec res;
ret=clock_gettime(CLOCK_MONOTONIC,&res);
if(ret==0){
time=res.tv_sec+(res.tv_nsec/1000000000);
} else {
... | true |
a6a0e58fb5b9ec3dcb6df61ee9ba498ce380a688 | C | julianfrancor/holbertonschool-low_level_programming | /0x05-pointers_arrays_strings/4-print_rev.c | UTF-8 | 320 | 3.875 | 4 | [] | no_license | #include "holberton.h"
/**
* print_rev - function that prints a string
* in reverse, followed by a new line.
* @s: input is a parameter
* Return: void
*/
void print_rev(char *s)
{
int i, j;
i = 0;
while (s[i] != 0)
{
i++;
}
for (j = (i - 1); j >= 0; j--)
{
_putchar(*(s + j));
}
_putchar('\n');
}
| true |
fc8d48df2caee4e9bab601065880a65d09020fd9 | C | Yekateryna/OS | /Lab5/task4/main.c | UTF-8 | 1,847 | 3.59375 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
double factor(double num)
{
if (num == 0)
{
return 1;
}
double answ = 1;
for(int i = 1;i<=num;i++)
{
answ*=i;
}
return answ;
}
int* erat(int n)
{
int* begining = (int*)malloc((n+1)*sizeof(int));
int counter = 0;
int* curren... | true |
a02208e42528caf0cc14eb65c815a838c9515fc3 | C | tranbrandont/minishell | /msh.c | UTF-8 | 5,448 | 2.578125 | 3 | [] | no_license | /* $Id: msh.c,v 1.48 2017/06/02 03:38:15 tranb7 Exp $ */
/* CS 352 -- Mini Shell!
*
* Sept 21, 2000, Phil Nelson
* Modified April 8, 2001
* Modified January 6, 2003
*
*/
/* Brandon Tran
* March 29, 2017
* CS 352
* Assignment 2
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#inc... | true |
7459c91c1ec60773e17ff322a05723fa9c0786e8 | C | willydlw/learn | /serial/c/linux/single_port/state_machine/communication_state.h | UTF-8 | 3,442 | 2.84375 | 3 | [] | no_license | /**
* Copyright (c) 2017 willydlw
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MIT license. See `main.c` for details.
*/
/** @file communication_state.h
*
* @brief Finite state machine definitions for communication
* with another program.
*
*
* @auth... | true |
768379cee89cf88a888925c9cf2cb63f8225356d | C | cloudcache/some_code | /8/main.c | UTF-8 | 1,072 | 3.578125 | 4 | [] | no_license | #include<stdio.h>
typedef struct TreeNode
{
char c;
struct TreeNode *leftchild;
struct TreeNode *rightchild;
}TreeNode;
int CompTree(TreeNode* tree1,TreeNode* tree2);
struct TreeNode* createTree( TreeNode * );
void showTree( TreeNode * );
int main(void)
{
TreeNode *tree1, *tree2;
tree1 ... | true |
01ae3585a3a7be844c1a0b5dc50411cb5726e1db | C | kruschk/etc | /C/suck.c | UTF-8 | 2,121 | 3.234375 | 3 | [
"MIT"
] | permissive | /* $Copyright: $
* Copyright (c) 1994 by Steve Baker (ice@mama.indstate.edu)
* All Rights reserved
*
* 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 of the License, or
* ... | true |
73ea9ac92e561e73127d29efb8f2092c8d95d69b | C | kxxrxx/rg_toggle | /rg_toggle2.c | UTF-8 | 3,631 | 2.890625 | 3 | [] | no_license | // If SW1 is pressed, the green LED will be toggled every half second (the red LED will be off).
// If SW1 is not pressed, the red LED will be toggled every half second (the green LED will be off).
// Whenever SW2 is pressed (no matter SW1 is pressed or not), all LEDs will be off.
// Considering the Tiva’s clock frequ... | true |
da304eb607aeb18b2fd7746c6df38a71efc35271 | C | Atul-kumar23/c-programming- | /C-program-to-enter-cost-price-and-selling-price-and-calculate-profit-or-loss.c | UTF-8 | 261 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
void main()
{
// sp=selling price,cp=cost price,p=profit,l=loss
int sp,cp,p,l;
printf("\n enter the selling price and cost price");
scanf("\n %d%d",&sp,&cp);
if(sp>cp)
printf("\n profit %d",sp-cp);
else
printf("\n loss %d",cp-sp);
}
| true |
984e8134cfcdde3a16384271daaa0661c2956641 | C | anchalagarwal08/PracticeQuestions_C | /testProg/tree/checkBinary.c | UTF-8 | 868 | 3.6875 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "Node.h"
#include <stdbool.h>
int countNodes(node *root, int *count)
{
if(root==NULL)
return 0;
countNodes(root->left, count);
(*count)++;
countNodes(root->right, count);
return *count;
}
bool checkBinary(node *root, int i, int count)
{
if(ro... | true |
d5547870a02f03a616a0c030a9a37220dd274906 | C | lucatinho/fatec | /3.c | UTF-8 | 324 | 3.5 | 4 | [] | no_license | #include <stdio.h>
int main(){
int a,b,c;
printf("informe o valor dos tres lados do triangulo:\n");
scanf("%d %d %d", &a, &b, &c);
if ((a == b)&&(b==c)){
printf("O triangulo e equilatero.");
}else if ((a == b)||(b==c)) {
printf("O triangulo e isosceles.");
}else{
printf("O triangulo e escaleno.");... | true |
00fcc77eff44cfe4564e2fe5840c30d55e148eb9 | C | SangwooJ/POS-system | /salesProcess.h | UHC | 8,324 | 2.671875 | 3 | [] | no_license | #pragma once
#include <stdio.h>
#include "DetermineBarcodeInfo.h"
#include "menu.h"
#include "printReceipts.h"
//void barcodeDataToProduct(productNow productList[],int i);
int isProductInTheList();
void salesProcess();
void printProductInTheList(productNow productList[], int b[7]);
void resetList(productNo... | true |
52a71182f6fb59edd576b42df2b8f93bae0f3fbb | C | jeromexlee/cs162hw3 | /mm_alloc.h | UTF-8 | 375 | 2.71875 | 3 | [] | no_license | /*
* mm_alloc.h
*
* Exports a clone of the interface documented in "man 3 malloc".
*/
#pragma once
#include <stdlib.h>
void *mm_malloc(size_t size);
void *mm_realloc(void *ptr, size_t size);
void mm_free(void *ptr);
/*struct of block*/
struct block {
struct block *prev;
struct block *next;
int free... | true |
14f894dee11d502db660102f84a36afbbb79c495 | C | yol63/lemin | /libft/kostyliivelosipedy.c | UTF-8 | 1,798 | 2.5625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* kostyliivelosipedy.c :+: :+: :+: ... | true |