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”);
fprintf(output,“Hello!\nWorld!”);
fclose(output);

}

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