Advertisement
saidmrn

Untitled

Oct 31st, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. for(nprod =0; nprod<=500;nprod++){
  2.  
  3. sprintf(localprod,"produtos\\%d.ini",nprod);
  4. if(ini = fopen(localprod, "r") != 0){ // se o arquivo existir,somar o I e mostrar o nome.
  5. ini = iniparser_load(localprod);
  6. nomeprodutosalvo = iniparser_getstring(ini, "info:nome", NULL );
  7. nprod = iniparser_getint(ini, "info:codigo", NULL );
  8. quantprod = iniparser_getint(ini, "info:quantidade", NULL );
  9. printf("Nome = %s Codigo = %d Quantidade = %d\n",nomeprodutosalvo,nprod,quantprod);
  10. i++;
  11. }
  12.  
  13. if(nprod == MAX_PROD){
  14. printf("numero total de produtos : %d",i);
  15. }
  16.  
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement