he below code works fine with dec c++ compiler but when run on visual studio gives the error at fseek
#include<stdlib.h>
#include<stdio.h>
#include<conio.h>
int main()
{
FILE *fp;
char *stringBuff;
int i;
int epi = 0;
long lSize;
fopen_s (&fp, "sequence.txt" , "rb" );
fseek (fp ,0 , SEEK_SET);
lSize = ftell (fp);
rewind (fp);
stringBuff = (char*) malloc (sizeof(char)*lSize);
fread (stringBuff,1,lSize,fp);
for(i = 0 ; i < lSize; i++)
epi = epi + 2 * (stringBuff[i] - 48 ) - 1;
printf("%d", epi);
getch();
return ;
}
//error Native' has exited with code 3 (0x3).