[try Beta version]
Not logged in

 
While loop of names.

Sep 10, 2015 at 5:18pm
C++ visual studio 2013
This is what I have so far. I am getting errors I do not understand.

#include <iostream>
#include <iomanip>
#include <string>
#include "Header.h"
using namespace std;

int main()
{
linkedListType <string> list1;
string first_name;
string last_name;
char another;

cout << "Type first name: ";
cin >> first_name;
cout << "Type last name: ";
cin >> last_name;
list1.insertLast(first_name, last_name);
cout << "Would you like to add another? Type y for yes or n for no: ";
cin >> another;


while (another == 'y')
{
cout << "Type first name: ";
cin >> first_name;
cout << "Type last name: ";
cin >> last_name;
list1.insertLast(first_name, last_name);
cout << "Would you like to add another? Type y for yes or n for no: ";
cin >> another;
}

list1.print();

cout << endl;

return 0;
}

I am trying to figure out how the linkedListType <string> list1; is coming up with an error. Also getting an error with the " Header.H"
Last edited on Sep 10, 2015 at 5:19pm
Sep 10, 2015 at 5:21pm
I am getting errors I do not understand.
If you do not understand the, then show them to somebody hwo do. Without error or fucll source code nobody would be able to tell what the problem is.

Also getting an error with the " Header.H"
Again, whic error? Do you really have such header in your project?
Sep 11, 2015 at 3:59am
We're not gonna be able to help with your header file error cuz..obvious reasons. *hint: it's not posted*

However, going by basic object types int, long, string, char, etc...(meaning no references, no pointers, no consts counting as object types) what is the type of linkedListType <string> list1;?

By the way, if this is a class assignment and you're allowed to use vectors, I'd use those instead of a string object.
Sep 11, 2015 at 12:32pm
if you remove the include "Header.h" do you still have errors ?
Sep 11, 2015 at 2:11pm
make sure the type of linkedListType is correct, u should post the header file too.
Topic archived. No new replies allowed.