Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- //STRUTTURE
- typedef struct nodo *Lista;
- typedef struct nodo{
- char riga[1000];
- Lista next;
- }nodo;
- //PROTOTIPI FUNZIONE
- void FileAcronimo(FILE *testo);
- void stampalista(Lista list);
- int main ()
- {
- FILE *pasquale;
- pasquale=fopen("ciaccarella bella.txt", "r");
- FileAcronimo(pasquale);
- fclose(pasquale);
- return 0;
- }
- void FileAcronimo(FILE *testo)
- {
- FILE *totore;
- nodo *N;
- Lista L=NULL;
- int count=0,al=0,asd=0;
- char cala[1000],lota[1000];
- totore=fopen("primicaratteri.txt","w");
- while(!feof(testo))
- {
- fgets(cala,1000,testo);
- N=malloc(sizeof(nodo));
- strcpy(N->riga,cala);
- N->next=L;
- L=N;
- lota[count]=L->riga[0];
- count++;
- printf("%c",lota[asd]);
- asd++;
- }
- while(al<count)
- {
- fprintf(totore,"%c",lota[al]);
- al++;
- }
- fclose(totore);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement