|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jan 2007
Città: villa verucchio
Messaggi: 1921
|
[c] problema con gestione array di stringhe
ho bisogno di un ciclo che a ogni stringa dell'array attribuisce il nome "utente1" "utente2"....però proprio non riesco, ho buttato giu questo, se ci potete mettere la mani mi fareste un gran favore! (per motivi didattici non dovrei usare funzioni esterne di gestione stringhe)
#include <stdio.h> #include <stdlib.h> int main() { char UTENTI[8][7]; int k=0; for (k=0; k<10;k++) { UTENTI [k]={'u','t','e','n','t','e','\0'} } printf("Ecco la classifica inizale: "); for(k=0; k<10; k++) { printf("%s\n",UTENTI[k]); } system("pause"); return 0; }
__________________
CPU: Amd Phenom II 955--MB: Gigabyte GA-890GPA-UD3H--RAM:4 GB DDR3--SV: ATI Radeon HD 5770--HD: Western Digital Caviar Black 500 gb--ALI:: Corsair 650w--MONITOR: SyncMaster P2270--ROUTER: Netgear DG834G--SO: Win 7 Professional 64 bit |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 17:20.



















