It's a very simple task, but there are two problems with my current implementation.
- I want it to read a whole line. It currently only reads the first few characters if they are separated by space. I think this can be fixed with a custom format, but I don't know what to use.
- Fortran needs to know how much to allocate and with my current implementation it can only read 10 characters. I want it to read without a limit. The only way that I know that can fix this right now is asking the user, how many characters they want to be read, but other programming languages can do this without it and I don't want to ask the user for additional things.
program main
implicit none
character(:), allocatable :: name
allocate(character(10) :: name)
read *, name
print *, name
deallocate(name)
end program main