Skip to content

Personal project to understand memory management and use it to simplify user input as a C library inspired by libcs50.

License

Notifications You must be signed in to change notification settings

joelabreurojas/input.h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

input.h
Logo

Library that uses heap to simplify user input in C.

 

✨ Overview

This is a C library, inspired by libcs50, that simplifies the process of getting user input. It provides a convenient way to display a message, read user input, filter it and return it if valid. If the input is invalid, the library repeats the process until valid input is received.

The main goal is to understand memory management with the heap as it is built, and to provide a higher level abstraction for handling user input. Contributions and suggestions are welcome to further improve and extend the functionality.

 

🔧 Set up

  1. Clone the repository.
  2. Link the path when you want execute your program.

 

💻 Usage

#include "input.h"

// The syntax is similar to <type> input = get_<type>("message");
// And type can be char, string (char *), double, float, integer and long

...

// Normal
char name = get_char("Message");

// Format
char name = get_char("%s", message);

// String case
char *name = get_string("Message");
char *name = get_string("%s", message);

...

 

👐 Contribute

Improvements?

  • Don't hesitate to create a PR.

Problems?

  • Feel free to open a new issue!

 

🔎 See more

About

Personal project to understand memory management and use it to simplify user input as a C library inspired by libcs50.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages