Originally Posted by
tabstop
Because "%ld\n" asks for two inputs, not one? You should look at the manual again:
So that \n will suck up all the new lines you care to give it until you type something else.
@quzah...Here is a complete main:
EDIT::: you will have to remove the function calls if you want it to compile.
Code:
#include stdio.h
int main(){
head = NULL;
tail = head;
long seed;
int num, i, startRange, endRange;
int numDelete;
printf("seed: ");
scanf("%ld\n", &seed);
printf("\nseed: %ld\n", seed);
init_seed(seed);
printf("range: ");
scanf("%d %d\n", &startRange, &endRange);
printf("beg: %d end: %d", startRange, endRange);
set_range(startRange, endRange);
return 0;
} //end main
and here is the output I get when using %ld
Code:
seed: 1234567
1234567
seed: 1234567
range: 1 9999
beg: 1234567 end: 1[mattsoma@athena:36]>
@tabstop...I realize that if I type 1234567 and hit enter, I can hit enter as many times as I want but when I enter 1234567 a second time it prints another new line and then asks for the range...however I thought the format string "%ld\n" means a long terminated by the enter key...