Advertisement
hasegawa

bin

Oct 12th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>              
  3. #include <string.h>
  4.  
  5.  
  6.  
  7. int main(int argc,char*argv[])
  8. {
  9.     FILE *fpi,*fpo;            
  10.     int face,vertex,point;
  11.     float data;
  12.    
  13.     if(argc!=5)
  14.     {
  15.         fprintf(stderr,"Usage: %s inputFILENAME.bin\n",argv[0]);
  16.         exit(1);
  17.     }
  18.         printf("OPEN FILE NAME:%s\n",argv[1]);
  19.    
  20.         if((fpi=fopen(argv[1],"rb"))==NULL)
  21.     {
  22.             fprintf(stderr,"Can not open\n");
  23.             exit(1);
  24.         }
  25.    
  26.        
  27.    
  28.         face=atoi(argv[2]);
  29.         vertex=atoi(argv[3]);
  30.     point=atoi(argv[4]);
  31.  
  32.     vertexAry=(GLfloat *)malloc(face*vertex*point*sizeof(GLfloat);
  33.     fread((GLfloat *)vertexAry,sizeof(GLfloat),face*vertex*point,fpi);
  34.    
  35.     fclose(fpi);
  36.     fclose(fpo);
  37.    
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement