Motivation is one of those things that come and go, frequently. I may feel motivated during the day, for a couple of hours or, maybe even days. On the other hand, lack of motivation may also manifest during the day, for a couple of hours, or maybe even days.

Credits: Image taken from Unsplash

Better yet, I would describe motivation as a positive mindset, the desire to be able to achieve a goal. Motivation is a vehicle that can be used to drive the bumpy road that leads to the goal, the end result. …

Notice the difference between the strings. Some extra spaces in there, right?

First, let’s take a look at the man page of this function. We can use the FreeBSD version of this function.

strtrim removes all whitespace characters from the beginning and the end of a string.

In other words, it will remove all the unnecessary white that you might have in a string, for instance:

char *str = "   Hello world! "
^^^ ^

Now that we know what it to do, let’s divide this implementation into small steps.

  1. Get the position within the string, where there is no white space at the beginning of it. …

Probably you are asking yourself, what is this?

A meme is worth than 9001 words:

Education just improved. Source: prnewswire.com

I would describe 42 as a tuition free coding school that revolves in a peer-to-peer ecosystem. It is very similar to a workplace, where critical thinking and problem solving skills go hand by hand, and a project based curriculum that can be completed at your own pace.

A student needs to have patience, determination, intuition, and a problem solving mindset. That’s why logic tests are simple, minimalist, and without instructions. …

You have probably seen a ternary operator (also known as a conditional expression) before in a source file, or somewhere else. In C, and in a lot of language with similar syntax, we use the ? character to represent this operator.

Most beginners (by my own experience), find it a bit difficult to understand this operator, even though they have already mastered the if and else statements. I believe the reason for this is that it is a bit difficult to read and to write it, because having different operations in the same line can be confusing. Really.

Most likely…

Can you do a strlen implementation in just one line? Being that line under 80 characters (no cheating), and without the use of if-else statements, and/or while loops?

Yes, you can.

size_t strlen(const char *s) 
{
return((*s)?(strlen(++s)+1):(size_t)*s);
}

Don’t believe me? Try to compile it.

How does it work?

Recursion :)

First, let’s create our string, a simple “Hello world!”.

Before getting into this subject, we first need to understand exactly what is a type in C.

What is a type?

“A type refers to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.”

yummy

Let’s say that every donut in the image above is a type. The chocolate one is an int, the one with the sprinkles are unsigned int, the one with white icing and sprinkles is a char, and so on… Every single one is different in some…

Today, Panama commemorates the memory of all people who died during the riots in 1964, caused by the conflict between Panamanian students (Instituto Nacional), and the Canal Zone Police officers.

This day should have been peaceful.

Governor Robert John Fleming prohibited to fly U.S. and Canal Zone flags outside schools, post offices, police stations and other civilian locations where it should be (outside the zone). Zonians (those associated with the Panama Canal Zone), were outraged by Fleming’s prohibition, and they began their demonstration with the U.S. flags. Students skipped classed, and raised another flag (Panamanian), and posted guards to prevent its removal.

Here is a list of some videos that can help you understand better some of the basic computer science concepts. Shout-out to Pannenkoek2012 for making this videos, check his Youtube Channel!

Floating Points

Underflow / Overflow

Random Number Generator

Vectors and Scalars

After reading this title, you’re probably feeling like this:

This may be a little hard to understand as first. I mean, a function parameter? You probably have some questions, such as:

  • The fuck is that!?
  • How does it works?
  • When should I use it?
  • Is it really worth it?

Fear no more! I shall answer all these questions, and more! ;)

Declaration

First, how do I declare this? A simple prototype for a function which takes a function parameter (sometimes called a formal parameter), is something like this:

void myfunction(void (*f)(int));

So… what???

This states that a parameter f will be…

Un makefile es un archivo de texto que tiene un conjunto de reglas, para automatizar la compilacion un programa, de forma simple y organizada. Make se puede usar para compilar cualquier lenguaje, pero en este caso usaremos el Lenguaje C.

Planilla de Makefile

El siguiente Makefile lo puedes usar como planilla para compilar sus programas en C de forma muy rapida.

# Nombre del programa
NAME = <nombre>
# Flags de compilacion
FLAGS = -Wall -Wextra -Werror -g -Ofast
# Directorios
SRC_DIR = ./srcs/
OBJ_DIR = ./obj/
INC_DIR = ./includes/
LIBFT_DIR = ./libft/
MINLBX_DIR = ./minilibx/
# Archivos fuentes y objetos
SRC_FILES =…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store