Hey guys I have a piece of code that I developed in using Visual Studio 2010 and now I need to run the code on my laptop which is a OSX machine. I know that I can't run visual studio on OSX so I'm trying to run it using XCODE. Most of the program runs fine...The only problem is when I go to output my data to a file it throws a 'EXC_BAD_ACCESS" error. I tried to create the file before hand and still has the error. The code snippet is below:
It throws the "EXC_BAD_ACCESS" error right at the fprintf line. Does anyone know what I'm doing wrong. I'm guessing that this is just a slight difference between the windows and mac enviroment but I have no idea what that difference is.
Thanks
-Joker
Code:
FILE * output;
output = fopen("results/results_12_12_1_1.txt", "w");
if(OUTPUT_FORMAT == 1){
while (!outputs.empty()) {
outy = outputs.front();
fprintf(output, "%d [%d %d] [%d %d] [%d %d %d]\n", outy.transfer_id, outy.begin_loc[0], outy.begin_loc[1], outy.end_loc[0], outy.end_loc[1], outy.num_cc_bus_wait, outy.num_cc_router_int_wait, outy.num_cc_router_wait);
outputs.pop();
}
}
It throws the "EXC_BAD_ACCESS" error right at the fprintf line. Does anyone know what I'm doing wrong. I'm guessing that this is just a slight difference between the windows and mac enviroment but I have no idea what that difference is.
Thanks
-Joker