Afficher un message
Vieux 16/09/2007, 09h21   #1
Alex Shulgin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut NoMethodError: undefined method `scanf' for main:Object

Hi,

I'm trying to use scanf(), but no luck:

$ ruby --version
ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux]
$ uname -a
Linux zrbite 2.6.21-2-686 #1 SMP Wed Jul 11 03:53:02 UTC 2007 i686 GNU/
Linux
$ irb
irb(main):001:0> w=scanf("%s")
NoMethodError: undefined method `scanf' for main:Object
from (irb):1
irb(main):002:0>

Trying to call $stdin.scanf() does not either (NoMethodError).
What I'm missing?


Cheers,
Alex

  Réponse avec citation
 
Page generated in 0,06028 seconds with 9 queries