I have checked my program hundred of times and I don't se nothing possibly wrong. Probably I also have a problem with the input:
Code: Select all
gets(S);
sscanf(S, "%d", &Cases);
gets(S);
while (Cases--) {
for (i=0;i<10;i++) Reg[i] = 0;
for (i=0;i<1000;i++) Word[i] = 0;
Words=0;
while (*(gets(S))) sscanf(S, "%d", &Word[Words++]);
Interp.exe < testfile.txt
Whe submitted, I get sigsegv. Sigsegv is avoited if program aborts when Address gets bad address.
I have even done a macro that converts values to long before making multiplications, and only converts them back to int after the modulus of 1000 has been applied.
Would it make a difference if I converted everything to long?
Can gets() work different there than here?
Help please