Doubt about the function that allows the reading of data in the elixir

Hi what would be the function that allows the reading of data in the elixir, as for example in C (scanf) or C ++ (cin).

Hello and welcome,

Please use english as language, as not everybody can speak portuguese.

You are looking for IO.gets I think…

4 Likes

thanks, by any chance there is some material to know how IO.gets works

You can start by the official documentation.

https://hexdocs.pm/elixir/IO.html#content

You have hyperlinks to directly access the code.

3 Likes

That is also directly available from the iex shell:

$  iex
Erlang/OTP 23 [erts-11.1.6] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]

Interactive Elixir (1.11.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> h IO



                                       IO                                       

Functions handling input/output (IO).

Many functions in this module expect an IO device as an argument. An IO device
must be a PID or an atom representing a process. For convenience, Elixir
provides :stdio and :stderr as shortcuts to Erlang's :standard_io and
:standard_error.

...


2 Likes

I think I knew it :slight_smile:

But sometime I forget…

And last day I was depressed, again, to find I gave the solution to an actual problem, some years ago, on this forum.

2 Likes