con la speranza che qualcuno mi risponda...avrei un problema non riesco a stampare un un puntatore a stringa...mi spiego meglio:
la printf da valore inesistenti... help
---------- Post added at 14:17 ---------- Previous post was at 12:25 ----------
possibile che nessuno può aiutarmi????
---------- Post added at 16:00 ---------- Previous post was at 14:17 ----------
ho provato anche cosi ma nn funziona....
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void){
char *word[10];
int i;
int j;
printf("Inizio\n");
printf("Inserisci una stringa\n");
for(i=0;i<5;i++){
scanf("%s",word);
}
//printf("hai inserito:\n");
// for (i=0;i<5; i++){
// printf("\n");
// for (j=0; word[j]='\0';j++){
// printf("%c",word[1][2]);
// }
// }
printf("%c",word[1][1]);
system("PAUSE");
return 0;
}
Codice:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX 100
void leggi(char *[]);
int main(void){
char *word[20];
printf("Inserisci una frase (ex/per terminare)\n");
leggi(word);
system("PAUSE");
return 0;
}
void leggi(char *vett[]){
int i;
for(i=0;i<4;i++){
scanf("%s",&vett[i]);
}
for(i=0;vett[i]!='\0';i++){
printf("%s\n",&vett[i]);
}
}
---------- Post added at 14:17 ---------- Previous post was at 12:25 ----------
possibile che nessuno può aiutarmi????
---------- Post added at 16:00 ---------- Previous post was at 14:17 ----------
ho provato anche cosi ma nn funziona....
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(void){
char *word[10];
int i;
int j;
printf("Inizio\n");
printf("Inserisci una stringa\n");
for(i=0;i<5;i++){
scanf("%s",word);
}
//printf("hai inserito:\n");
// for (i=0;i<5; i++){
// printf("\n");
// for (j=0; word[j]='\0';j++){
// printf("%c",word[1][2]);
// }
// }
printf("%c",word[1][1]);
system("PAUSE");
return 0;
}