For some odd reason file declaration works differently in Visual Studio than it does in code blocks. The following code runs perfectly fine in code:blocks but won't run in Visual Studio, and I don't have a clue why not Couldn't figure it out.
int n;
FILE * pFile;
pFile = fopen ("date.in","r");
fscanf(pFile,"%d",&n);
printf("%d", n);
return 0;
using cstdio and stdafx respectivly edit 1:
// ConsoleApplication3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int d;
int main ()
{
FILE * inFile;
inFile = fopen("date.in", "r");
fscanf(inFile, "%d", &d);
printf("%d", d);
return 0;
}
Triggers a break point line 1061 of stdio.h