Skip to content

Instantly share code, notes, and snippets.

View davixcky's full-sized avatar
⌨️
C lover and vim adict

David Orozco davixcky

⌨️
C lover and vim adict
View GitHub Profile
@davixcky
davixcky / README-español.md
Created January 14, 2018 03:26 — forked from Villanuevand/README-español.md
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas. Mira Despliegue para conocer como desplegar el proyecto.

@davixcky
davixcky / API.md
Created July 24, 2018 23:46 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

What happens when you type gcc main.c?

First of all, what is gcc? If we want to know What happens when you type gcc main.c, we need to know the base of all, gcc

enter image description here

GCC

enter image description here

GCC stands for GNU Compiler Collection (produced by the GNU - G nu is N ot U nix), that the name say, is a set of compilers for various languages. It provides all the infrastructure for building a entire software, like a front-end builder.

#include "mylib.h"
int main(int argc, char **argv)
{
print_message(argv[argc == 1? 0 : argc - 1]);
return 0;
}
#include "mylib.h"
int main(int __attribute__((__unused__)) argc, char **argv)
{
print_message(argv[argc == 1? 0 : argc - 1]);
return 0;
}
#ifndef MYLIB_H
#define MYLIB_H
void print_message(char *);
#endif
#include "mylib.h"
#include <stdio.h>
void print_message(char *message)
{
printf("The message is \"%s\"\n", message);
}
@davixcky
davixcky / commands
Created March 1, 2020 21:35
Commands for create the library and link to the main.c
gcc mylib.c
ar rcs libmylib.a *.o
gcc main.c -L. -lmylib -o message
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int _strlen(const char *str)
{
int i;
for (i = 0; str[i] != 0; i++)
;