vector iterator not dereferencable 에러가 납니다.

lcj861의 이미지

학교 프로젝트로 프로그래밍중인데요
제가 지금 짜고 있는 프로그램은
사업체 이름을 벡터에 보관해서 리스트를 만드는겁니다.
예) walmart 라고 치면
your business is
walmart.
그다음에 다시 물어봅니다 what is your business?
그럼 다시 jc penny 라고 치면
your business is

walmart
jc penny

이런식으로 나열해가는건데
찾아보니 vector iterator not dereferencable 이라는게 벡터 메모리 문제라는거 같은데
고수님들 도와주십시오 ㅠㅠ

#include
#include
#include
#include

using namespace std;

int main()
{
string busi;
stringstream ss;

vector busilist;
vector::const_iterator iter;
while(true)
{
for (size_t i= busi.length() - 1 ; i; ++i)
cout << " \t\t Welcome to Business sorting program!!\n\n" << endl;
cout << " What is your business name? ";
getline(cin,busi);
busilist.push_back(busi);
busilist.begin(),busilist.end();
ss >> busi;
cout << "Your business is....\n\n" << *iter << endl;
}


return 0;

}

lcj861의 이미지

#include <.iostream.> ( <> 이사이에 있는 말이 자꼬 잘리네요 그래서 중간에 . 을 넣었습니다)
#include <.string.>
#include <.sstream.>
#include <.vector.>

입니다

중간에

vector<.string.> busilist;
vector<.string.>::const_iterator iter;

부탁드립니다

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.