Hello to all,
I am having a problem with my program. I am receiving an error message "Segmentation fault" when I run it. Here is my code:
The sequence I am trying to build up is going to be about 5 million characters and the file I am inputing is pretty big; about 12 MB. Any help would be great.Code:main( int argc, char **argv ) { FILE *input ; FILE *output ; char buffer[1000] ; char sequence[100000000] ; char c ; int i = 0 ; if( ! ( input = fopen( argv[1], "r" ) ) ) { printf( "COULD NOT OPEN FILE %s - Exit!\n", argv[1]) ; exit(1) ; } while(fgets(buffer, 1000, input)) { // start obtaining bases after ORIGIN if(strstr(buffer, "ORIGIN")) { int n = 0 ; while((c=getchar()) != '/') { if(c >= 'a' && c <= 'z') { sequence[i++] = c ; } } } } printf("Here is the sequence:\n" ) ; return(0) ; }
Thanks



LinkBack URL
About LinkBacks



