Originariamente inviato da anx721
non lo so
Perchè mi dà errore questo script?
codice:
FILE *fp;
char ch;
char buf[100];
char cha;
char word;
int bytes;
/* Start the main object */
int main()
{
/* Read the word from the console */
printf("Digita la parola da scrivere nel file:\n");
scanf("%a",word);
/* Count the characters in word */
bytes = sizeof(word);
/* Open the file */
fp = fopen("TEXT_WRITE.TXT", "w");
/* Write the file */
ch = fwrite(word , bytes, 1, fp);
/* Close the file */
fclose(fp);
/* Insert the text to close the program */
printf("Premi un tasto ed INVIO per uscire\n\n");
scanf("%a", &cha);
}
Note:
25 ...\Scrittura.cpp invalid conversion from `char' to `const void*'