C question about scanf

Batis bat_geor at mail.hol.gr
Tue Sep 14 18:59:03 EEST 1999


De mou lete,

sto Linux, me compiler ton gcc, pws mporoume na perasoume ena long integer
ap'tin sscanf se mia variable.

Px. exoume char line[80]; opou exei to periexomeno:
0 123 3441234 532525 4634636 575745 (pithana kai kana \n sto telos)

kai exoume to long lt[6];

Pws prepei na grapsw tin sscanf gia na valei swsta tis times?

Dokimasa to:
sscanf(line, " %d %d %d %d %d %d", lt, lt+1, lt+2, lt+3, lt+4, lt+5);

kai vazei swsta ola, ektos ap'to teleytaio, pou bazei mia diki tou timi me
6-7 psifia.

Computers let you make More mistakes faster than any other invention in
human history, with the possible exception of handguns and tequila.
 - Mitch Radcliffe
  ,       _/ _/  .   _/    _/       Jim JMK Batis' Web Site:   `       *
 . *   ` _/ _/_/  _/_/  _/     *         http://jmk.simplenet.com/  .  ,
     ,  _/ _/  _/` _/_/    ,       ,    .      +       `
 _/    _/ _/  *   _/  _/       +    E-mail address:    .       .    `
  _/_/   _/ `    _/    _/  *      ,      bat_geor at mail.hol.gr   .-._
.  AIM Screen name: Irwas   .     * ICQ UIN: 18204204        +   '. '.  *
         +        +      .     ,    '   '          *              |  |
 JMK Productions: http://jmk.simplenet.com/prod/ FreeWare Utils   , .'
 JMK Web Designs: http://jmk.simplenet.com/wd/    ,  .      `    ,.'
 Member of HTML Writers' Guild: http://www.hwg.org/      ,         *  .
 Greek Metallers Mailing List: http://jmk.simplenet.com/grmetallers/
 Seventh Sign - Heavy Metal Magazine: http://users.hol.gr/~sevsign/  *
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/archives
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list