October 25, 2024
Chicago 12, Melborne City, USA
C++

How to work with stl files in C to write them in bin/txt


I don’t know how to call a file in a function, and I’m now even sure If my code is good for the given task, basically I two .stl files one to convert into a .txt file the other one into a .bin file using c. ive written some code but when I try to run it it says that it can’t open the file.

small portion of the code, but the problem must start here

ive seen online that I’m supposed to call a file in a function using. something like this.

but that just prints a error

Objekt3D* citaj_binarni_stl(const char* primjerbin)

Objekt3D* citaj_binarni_stl(const char* primjerbin) {
    FILE *file = fopen("primjerbin.stl", "rb");
    if (file == NULL) {
        printf("Greska pri otvaranju binarne datoteke.\n");
        return NULL;
    }



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video