This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct example { | |
void (*add)(struct example *, int); | |
void (*show)(struct example *); | |
int number; | |
}; | |
void example_add(struct example *this, int n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Just a simple crackme. | |
* For compile this crackme, download the CCS tool from: | |
* https://github.com/Silva97/cli-tools | |
* | |
* And run: | |
* $ gcc `./ccs crackme00.c` -o crackme00 | |
*/ | |
#include <stdio.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
int asmdiv(uint64_t highq, uint64_t lowq, uint64_t divisor) | |
{ | |
uint64_t quotient; | |
uint64_t modulous; | |
__asm__ __volatile__ ( | |
"movq %[highq], %%rdx\n\t" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://medium.com/@FreeDev/modularizando-c%C3%B3digo-em-c-784dc52d1c34 | |
#include <stdio.h> | |
#include "module.h" | |
int main(void) | |
{ | |
printf("Valor: %d\n", sum(3, 7)); | |
return 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int getint(int *number); | |
int main() | |
{ | |
int n; | |
fputs("Digite um inteiro cara: ", stdout); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <inttypes.h> | |
uint32_t fib(int n) | |
{ | |
register uint32_t r = 0; | |
__asm__( | |
"mov $1, %%ebx\n\t" | |
".lp%=:\n\t" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
fputs("Dia da semana(1~7): ", stdout); | |
printf("Nome do dia: %s\n", | |
((char [][16]){ | |
"Domingo", | |
"Segunda", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int operator +(int x, std::string str){ | |
return x + std::stoi(str, nullptr, 10); | |
} | |
int main(void) | |
{ | |
int x = 5; | |
std::string str = "13"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************* | |
* Resolução do problema: https://leetcode.com/problems/reverse-integer/ | |
*********************/ | |
int aux_rev(int x, long long int rev) | |
{ | |
if(rev > INT_MAX || rev < INT_MIN) return 0; | |
if(!x) return rev; | |
return aux_rev(x/10, rev*10 + x%10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct test { | |
char str[10]; | |
int n; | |
}; | |