Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(int argc, char *argv[])
- {
- //Decralation of variables
- FILE *fpi,*fpo;
- float x,y,z;
- char point[4];
- //Open CSV file
- if((fpi=fopen(argv[1],"r"))==NULL)
- {
- printf ("The file can't be opened. The program is exit.\n");
- return 0;
- }
- //Open VTK file for save
- if((fpo=fopen(argv[2],"wb"))==NULL)
- {
- printf("The file can't be opened. The program is exit.\n");
- return 0;
- }
- while(fscanf(fpi,"%f %f %f",&x,&y,&z)!=EOF)
- {
- printf("%f %f %f\n",x,y,z);
- fwrite(&x,sizeof(float),1,fpo);
- fwrite(&y,sizeof(float),1,fpo);
- fwrite(&z,sizeof(float),1,fpo);
- }
- fclose(fpi);
- fclose(fpo);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement