|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Oct 2004
Messaggi: 98
|
Suddividere stringa
Ciao a tutti. Io ho un problema: come faccio a suddividere una stringa che è composta da più stringhe, di numero non fisso ???
Es: stringa = " Questa è la stringa da suddividere" oppure stringa = " Questa è una stringa " Cioè io ho una stringa intera che prendo con la gets() poi però devo prendere le varie sottostringhe da cui è formata. COme devo fare? |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
Comunque usa la funzione strtok(), chiaramente devi stabilire quali sono i caratteri che fungono da delimitatori (ad esempio: spazi e/o tab). P.S. gets() è insicura, usa fgets().
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#3 |
Member
Iscritto dal: Oct 2004
Messaggi: 98
|
Si il linguaggio è il C, scusate...
Ora provo e vedo se funziona grazie! |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:54.