Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void valoreN()
- {
- //F = fopen("db.bin","rb");
- fseek(F,sizeof(int),SEEK_SET);
- int lunghezza;
- fread(&lunghezza,sizeof(int),1,F);
- //int lunghezza=ftell(F);
- printf("N VALE: %d",lunghezza);
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- F = fopen("db.bin","rb");
- if(F==NULL)
- {
- F = fopen("db.bin","wb");
- do
- {
- printf("file di salvataggio non trovato! \nQuanti interi vuoi usare(MAX 10'000 e MIN 1)? ");
- scanf("%d",&n);
- fwrite(&n,sizeof(int),1,F);
- }
- while((n>10000)||(n<1));
- }
- valoreN();
- fclose(F);
- vettore=(articolo *)malloc(sizeof(articolo)*n);
- do{
- menu();}
- while(sceltamenu!=7);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement