I am creating a linked list from the keyboard and when executing its giving me a endless loop and i'm not sure why, some help would be greatly appreciated.
Wow, please use functions as well as "new" and "delete" keywords. Your program will leak memory now, since you don't free() it (and we don't really use malloc in C++).
As for why you've got endless loop, the answer is simple: while(pre)... loop never updates pre. Go along the if and see your mistake.
Oh i see, the book my class is using is written in C but i prefer C++, so I was following the guidelines from that. I will check out the "new" and "delete" keywords. And i see why now its giving me a endless loop now. Thanks for the help