Skip to content

Instantly share code, notes, and snippets.

View Silva97's full-sized avatar

Luiz Felipe Silva97

View GitHub Profile
function sum(...args){
var result = 0;
if(args.length == 4){
for(let i = 0; i < args.length; i++)
result += args[i];
return result;
} else {
return function(...newArgs){
/********************
* Exemplo maluco por Luiz Felipe.
*
* https://github.com/Silva97
********************/
#include <stdio.h>
#define UCHARPTR (unsigned char *)
/********************
* Exemplo de replace em C.
* Por Luiz Felipe.
* https://github.com/Silva97
********************/
#include <stdio.h>
#include <string.h>
int replace(char *text, char *word, char *new);
@Silva97
Silva97 / lscanf.c
Last active November 3, 2022 13:35
Maneira segura de pegar o input do usuário
/********************
* Developed by Luiz Felipe.
*
* GitHub: https://github.com/Silva97
* Facebook: https://www.facebook.com/B4.0E.B0.48.CD.10.B0.69.CD.10.C3
********************/
#include <stdio.h>
#include <stdarg.h>
#include <limits.h>
#include <stdio.h>
#define MAX_STACK 64
typedef struct stack {
int value[MAX_STACK];
int size;
} Stack;
void push(Stack *s, int value);
/********************
* Desenvolvido por Luiz Felipe
* https://github.com/Silva97
*
* Algoritmo feito em resolução de um desafio
* cujo o objetivo era apresentar o menor número
* de persistência indicada pelo usuário.
*
* Desafio no grupo Programação em C:
* - https://www.facebook.com/groups/414761988665865/permalink/1144414109033979/
/********************
* Exemplo por Luiz Felipe
* https://github.com/Silva97
********************/
#include <stdio.h>
#include <unistd.h>
#define FNAME "exemplo.dat"
/********************
* Exemplo por Luiz Felipe.
* https://github.com/Silva97
********************/
#include <stdio.h>
#include <string.h>
#include <unistd.h> // Para usar chdir()
#include <dirent.h>
/********************
* Exemplo básico de uso de sockets no Linux.
* Por Luiz Felipe - https://github.com/Silva97
*
* Link do vídeo: https://youtu.be/GaxjJvMnz-I
********************/
#include <stdio.h>
#include <winsock2.h>
/********************
* Exemplo básico de uso de sockets no Linux.
* Por Luiz Felipe - https://github.com/Silva97
*
* Link do vídeo: https://youtu.be/GaxjJvMnz-I
********************/
#include <stdio.h>
#include <unistd.h>