The purpose of this library is to provide initial support to Info1 (Introduction to CS) students at National Technological University as they begin programming in C, in the same way that training wheels work on a bicycle. It is based on Harvard CS50's libcs50.
To build the library from source, the following tools are needed:
- git
- make
- gcc
On Ubuntu/Debian, you can install them with:
$ sudo apt-get install git build-essential
On other platforms, please use the corresponding package managing tool to install them before proceeding.
You can get the source by "git clone" this git repository.
$ git clone https://github.com/jballoffet/libinfo1.git
To build the library execute the following:
$ cd libinfo1
$ make
To install the library execute the following:
$ cd libinfo1
$ sudo make install
Note: By default, the library will be installed to /usr/local
. In case you'd like to change the installation location, change the value of INSTALL_DIR
in the Makefile.
To uninstall the library execute the following:
$ cd libinfo1
$ sudo make uninstall
To run the test application execute the following:
$ cd libinfo1
$ make test
If the library is installed, just link with linfo1
, e.g.:
$ gcc -Wall -o app main.c -linfo1
If the library isn't installed, place the static library (libinfo1.a
) in a known location and link with linfo1
, e.g.:
$ gcc -Wall -o app main.c -L<library location> -linfo1
Then you can use it as follows:
#include <info1.h>
//...
String s = obtener_string("Ingrese un string: ");
char c = obtener_char("Ingrese un char: ");
int i = obtener_int("Ingrese un int: ");
long l = obtener_long("Ingrese un long: ");
float f = obtener_float("Ingrese un float: ");
double d = obtener_double("Ingrese un double: ");
//...
This project is licensed under the MIT License. See the LICENSE file for details.
Library inspired by and based on: