User Profile

Collapse

Profile Sidebar

Collapse
edyam
edyam
Last Activity: Apr 28 '08, 02:41 AM
Joined: Dec 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • edyam
    started a topic cin >> string looping infinitely
    in C

    cin >> string looping infinitely

    Because of a simple cin statement, my program goes into an infinite loop and I'm not sure why. I've used the same code in other programs (only with different variable names and cout statements) and it's worked fine. See code below:

    Code:
    int main () 
    {
    	BinaryHeap pQueue; // create empty heap
    	bool acceptCommand = true;
    	string command; // function to perform
    	
    	while (acceptCommand)
    ...
    See more | Go to post

  • edyam
    replied to Error on template functions returning pointers
    in C
    Sorry about the mixup! lol. Both of you have been extremely helpful. Using both of your suggestions, I'm no longer getting the original error messages, but the whole project still wont compile correctly. I intend to work on it some more later this evening, and I'll be sure to let you know about any new error messages I may get.

    Thanks again for all your help.
    See more | Go to post

    Leave a comment:


  • edyam
    replied to Error on template functions returning pointers
    in C
    Re: Ganon

    Adding 'typename' before the function results in the following error:
    error: expected nested-name-specifier before 'List'

    Re: tavianator

    They're in two seperate files, but I've included

    #include "ListTemplate.c pp"

    at the bottom of ListTemplate.h, as per my professor's instructions for the project. This should be equivalent to having them in the...
    See more | Go to post

    Leave a comment:


  • edyam
    replied to Error on template functions returning pointers
    in C
    I tried commenting out the three functions that were giving me errors, but that just caused me to get the following error on the first line of every member function:

    error: expected initializer before '<' token

    Any ideas/suggestions? Thanks in advance!
    See more | Go to post

    Leave a comment:


  • edyam
    replied to Error on template functions returning pointers
    in C
    That makes a lot of sense, tavianator, but I'm still getting the same error. Thanks anyway....
    See more | Go to post

    Leave a comment:


  • edyam
    replied to Error on template functions returning pointers
    in C
    Thanks, Ganon, but all that does is produce the following error...

    error: expected constructor, destructor, or type conversion before '<' token

    Thanks again!...
    See more | Go to post

    Leave a comment:


  • edyam
    replied to Error on template functions returning pointers
    in C
    Hmm... Thanks for the suggestion, but it didn't seem to make a difference. Any other ideas?

    Thanks again!
    See more | Go to post

    Leave a comment:


  • edyam
    started a topic Error on template functions returning pointers
    in C

    Error on template functions returning pointers

    I'm trying to template a pointer-based list class and several functions (the ones in which I try to return a pointer) are producing error messages.

    The class:

    Code:
    template <typename T>
    class List : public BasicADT
    {
    	public:
    		
    		List();     // constructor
    		List(const List<T>& aList);	// copy constructor
    		virtual ~List();	// destructor
    ...
    See more | Go to post
No activity results to display
Show More
Working...