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-essentialOn 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.gitTo build the library execute the following:
$ cd libinfo1
$ makeTo install the library execute the following:
$ cd libinfo1
$ sudo make installNote: 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 uninstallTo run the test application execute the following:
$ cd libinfo1
$ make testIf the library is installed, just link with linfo1, e.g.:
$ gcc -Wall -o app main.c -linfo1If 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> -linfo1Then 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: