Baloff <[EMAIL PROTECTED]> writes:
> Hello
>
> coding in C++, I have a linked list to store int, but when I store
> double it is not working and I tried to find out why but could not,
>
> thanks for looking at this problem
>
> output************************************************************
> @debian:~/Exercies/ThinkingInC++/Vol1/4thCh/7$ ./proj1
> dblStash.fetch(0) = 0
> dblStash.fetch(1) = 1
> dblStash.fetch(2) = 2
> dblStash.fetch(3) = 3
> dblStash.fetch(4) = 4
> freeing storage
> @debian:~/Exercies/ThinkingInC++/Vol1/4thCh/7$ ./proj1
> dblStash.fetch(0) = 1.6976e-313
> dblStash.fetch(1) = 1.6976e-313
> dblStash.fetch(2) = 1.6976e-313
> dblStash.fetch(3) = 1.6976e-313
> dblStash.fetch(4) = 1.6976e-313
> freeing storage
> @debian:~/Exercies/ThinkingInC++/Vol1/4thCh/7$
You need to put doubles into the list if you want to get doubles out of it!
This is the standard GIGO principle: garbage in, garbage out.
> dblStash.add(&i);
Replace with:
double d=(double)i;
dblStash.add(&d);
--
__Pascal Bourguignon__ http://www.informatimago.com/
In deep sleep hear sound,
Cat vomit hairball somewhere.
Will find in morning.
_______________________________________________
Help-gnu-emacs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs