File print and bus error

Hi, every one
I am very new to cuda. The installation of cuda toolkit was fine. However, when I tried to open an file to write data, I always got bus error. Here is one example:

#include <stdio.h>
#include <cuda.h>

int main(int argc, char** argv){

FILE *output;
output = fopen(“Hello.txt”,“w”);


When I compile it with gcc x.c -o x, it works. However, if I save it as and compile with nvcc -o x, and run, I have bus error. I am using Mac Air with NVIDIA GeForce 9400M graphics. Can anybody help me? Thanks!