Skip to content

Using C from Cone: calling fopen() #65

@jt9897253

Description

@jt9897253

Hello,

when trying to call fopen() from cone, the program exits with a segmentation fault.
This is tested on macOS, the code is:

import stdio::*

struct @opaque file

extern:
  fn fopen(filename &[]u8, mode &[]u8) *file

fn main():
  mut testFile = fopen("test", "w")

Is it possible to call fopen() from cone, and if yes, could you please give me a hint how to do it?
Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions