Hi,
I have writtten this C script to produce a series of numbers. However, it seems there is an overflow somewhere and a storage buffer is being filled when it should not be filled.
The output is controlled by the variables DIGIT_LENGTH and MAX
Where DIGIT_LENGTH is the number of digits in a sequence and MAX is how high to count these digits in a sequence.
For example, DIGIT_LENGTH = 3;...
User Profile
Collapse
-
Unique number sequencer problem
...Code:#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct {int key; int digit; int string[2];}person; //int pass(man a[]); int main() { int apo; int x; int digit_length = 3; double max = 4; FILE *fp; int store = 1000000; person *txPtr; if( -
Silvine replied to Segmentation fault in C program using MS-DOS and fgets under Windows after program inin CI cannot post the full code because the forum is restricting me from posting 1000 lines of code. Apologies.Leave a comment:
-
Silvine replied to Segmentation fault in C program using MS-DOS and fgets under Windows after program inin C...Code:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> int main() { char buffer[1024]; char compare[1024]; int record_id = 0; time_t now; struct tm *localnow; char hdr_date[999] = ""; FILE *fp; typedef struct { char Customer_ID[256]; char Name[256];Leave a comment:
-
Silvine started a topic Segmentation fault in C program using MS-DOS and fgets under Windows after program inin CSegmentation fault in C program using MS-DOS and fgets under Windows after program in
When I enter input into a while loop for fgets on program initialisation I get a seg fault. Can anyone see why?
No activity results to display
Show More
Leave a comment: